Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to pip install depthai-sdk #973

Open
franva opened this issue Mar 17, 2023 · 5 comments
Open

Not able to pip install depthai-sdk #973

franva opened this issue Mar 17, 2023 · 5 comments
Assignees
Labels
sdk Related to DepthAI SDK

Comments

@franva
Copy link
Contributor

franva commented Mar 17, 2023

Followed the instruction to install depthai-sdk by running:

python3 -m pip install depthai-sdk

on my RPi 4 with 4GB ram 32GB SD card.
OS Details:

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian

It errors out when installing opencv-contrib-python.

Here is the details error message I copied from the terminal.


 [ 98%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2_convert.cpp.o
      [100%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2_highgui.cpp.o
      [100%] Linking CXX shared module ../../lib/python3/cv2.abi3.so
      collect2: fatal error: ld terminated with signal 11 [Segmentation fault]
      compilation terminated.
      /usr/bin/ld: /usr/local/lib/libx264.a(base.o): relocation R_ARM_MOVW_ABS_NC against `stderr@@GLIBC_2.4' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(api.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(bitstream-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(encoder-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(lookahead-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(threadpool-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(bitstream-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(encoder-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(lookahead-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(threadpool-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(mc-8.o): relocation R_ARM_MOVW_ABS_NC against `x264_hpel_ref0' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(predict-8.o): relocation R_ARM_MOVW_ABS_NC against `x264_8_predict_16x16_v_c' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(pixel-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(macroblock-8.o): relocation R_ARM_MOVW_ABS_NC against `x264_zero' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(frame-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(dct-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(cabac-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(set-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(quant-8.o): relocation R_ARM_MOVW_ABS_NC against `x264_decimate_table4' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(deblock-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(vlc-8.o): relocation R_ARM_MOVW_ABS_NC against `x264_8_level_token' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(mvpred-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(analyse-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(me-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(ratecontrol-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(set-8.o): relocation R_ARM_MOVW_ABS_NC against `x264_cqm_jvt' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(macroblock-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(cabac-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(cavlc-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(mc-c-8.o): relocation R_ARM_MOVW_ABS_NC against `x264_hpel_ref0' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(predict-c-8.o): relocation R_ARM_MOVW_ABS_NC against `x264_8_predict_4x4_h_armv6' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(mc-10.o): relocation R_ARM_MOVW_ABS_NC against `x264_hpel_ref0' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(predict-10.o): relocation R_ARM_MOVW_ABS_NC against `x264_10_predict_16x16_v_c' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(pixel-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(macroblock-10.o): relocation R_ARM_MOVW_ABS_NC against `x264_zero' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(frame-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(dct-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(cabac-10.o): relocation R_ARM_MOVW_ABS_NC against `x264_cabac_context_init_PB' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(set-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(quant-10.o): relocation R_ARM_MOVW_ABS_NC against `x264_decimate_table4' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(deblock-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(vlc-10.o): relocation R_ARM_MOVW_ABS_NC against `x264_10_level_token' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(mvpred-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(analyse-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(me-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(ratecontrol-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(set-10.o): relocation R_ARM_MOVW_ABS_NC against `x264_cqm_jvt' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(macroblock-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(cabac-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(cavlc-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(mc-c-10.o): relocation R_ARM_MOVW_ABS_NC against `x264_10_memcpy_aligned_neon' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(dct-a-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(mc-a-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(pixel-a-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(predict-a-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(quant-a-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(mc-a-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(rectangle-8.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: /usr/local/lib/libx264.a(rectangle-10.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/build.make:275: lib/python3/cv2.abi3.so] Error 1
      make[2]: *** Deleting file 'lib/python3/cv2.abi3.so'
      make[1]: *** [CMakeFiles/Makefile2:5184: modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
      make: *** [Makefile:166: all] Error 2
      Traceback (most recent call last):
        File "/tmp/pip-build-env-dt7qd10i/overlay/lib/python3.7/site-packages/skbuild/setuptools_wrap.py", line 642, in setup
          cmkr.make(make_args, install_target=cmake_install_target, env=env)
        File "/tmp/pip-build-env-dt7qd10i/overlay/lib/python3.7/site-packages/skbuild/cmaker.py", line 679, in make
          self.make_impl(clargs=clargs, config=config, source_dir=source_dir, install_target=install_target, env=env)
        File "/tmp/pip-build-env-dt7qd10i/overlay/lib/python3.7/site-packages/skbuild/cmaker.py", line 711, in make_impl
          "An error occurred while building with CMake.\n"
      
      An error occurred while building with CMake.
        Command:
          /tmp/pip-build-env-dt7qd10i/overlay/lib/python3.7/site-packages/cmake/data/bin/cmake --build . --target install --config Release --
        Install target:
          install
        Source directory:
          /tmp/pip-install-obljb4mk/opencv-contrib-python_ebf1de4a4cec48b3b5baa5e7a67c4958
        Working directory:
          /tmp/pip-install-obljb4mk/opencv-contrib-python_ebf1de4a4cec48b3b5baa5e7a67c4958/_skbuild/linux-armv7l-3.7/cmake-build
      Please check the install target is valid and see CMake's output for more information.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for opencv-contrib-python
Failed to build opencv-contrib-python
ERROR: Could not build wheels for opencv-contrib-python, which is required to install pyproject.toml-based projects
@Erol444 Erol444 transferred this issue from luxonis/depthai-python Mar 17, 2023
@franva
Copy link
Contributor Author

franva commented Mar 19, 2023

Btw, I have
opencv-python 4.4.0.46
opencv-python-headless 4.1.1.26
installed.

So if the depthAI-sdk doesn't require all opencv functions, maybe a quick fix could be replace the opencv-contrib-python with opencv-python.

@themarpe
Copy link
Collaborator

@franva

You must only have one opencv installed. As per: https://github.com/opencv/opencv-python#installation-and-usage

I suggest removing all others & just retain the contrib.
Contrib is needed due to bringing in the required parts for calibration, etc...

@themarpe
Copy link
Collaborator

CC: @daniilpastukhov - if we remove other opencv version in install_requirements.py make sure we also uninstall variants like -headless, etc...

@franva
Copy link
Contributor Author

franva commented Mar 20, 2023

@franva

You must only have one opencv installed. As per: https://github.com/opencv/opencv-python#installation-and-usage

I suggest removing all others & just retain the contrib. Contrib is needed due to bringing in the required parts for calibration, etc...

Hi @themarpe
Thanks for the suggestion.

I am a bit hesitate to uninstall opencv-python as I remember it took me a bit while to install it last year(errored out so many times so many places etc.).

Did you say that the issue is possibly caused by the existing opencv-python lib in my RPi system?
If yes for sure, then I can try to uninstall my opencv-python for installing the full package of opencv.

Thanks,

Winston

@themarpe
Copy link
Collaborator

Did you say that the issue is possibly caused by the existing opencv-python lib in my RPi system?
If yes for sure, then I can try to uninstall my opencv-python for installing the full package of opencv.

It might be. According to their doc, there shouldn't be multiples of those.
Backup your system or create a copy of the lib - I cannot be for sure on this one unfortunatelly

@Erol444 Erol444 added the sdk Related to DepthAI SDK label Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sdk Related to DepthAI SDK
Projects
None yet
Development

No branches or pull requests

4 participants