Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
482 views
in Technique[技术] by (71.8m points)

Failed to build opencv-contrib-python (On Rasberry Pi)

I'm trying to install OpenCV on my Rasberry Pi but when I run the following command, I get some errors. Command:

pip install opencv-contrib-python

Results:

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting opencv-contrib-python
  Using cached opencv-contrib-python-4.5.1.48.tar.gz (148.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: numpy>=1.14.5 in ./.local/lib/python3.7/site-packages (from opencv-contrib-python) (1.19.5)
Building wheels for collected packages: opencv-contrib-python
  Building wheel for opencv-contrib-python (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python3 /usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp5g982u_t
       cwd: /tmp/pip-install-v1dx6hv5/opencv-contrib-python_85b21e0e2a604411afeb4dda9ea29270
  Complete output (12 lines):
  patching file opencv/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp
  /tmp/pip-build-env-eoujog_o/overlay/lib/python3.7/site-packages/cmake/data/bin/cmake: /usr/lib/arm-linux-gnueabihf/libssl.so.1.1: version `OPENSSL_1_1_1' not found (required by /tmp/pip-build-env-eoujog_o/overlay/lib/python3.7/site-packages/cmake/data/bin/cmake)
  /tmp/pip-build-env-eoujog_o/overlay/lib/python3.7/site-packages/cmake/data/bin/cmake: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by /tmp/pip-build-env-eoujog_o/overlay/lib/python3.7/site-packages/cmake/data/bin/cmake)
    File "/tmp/pip-build-env-eoujog_o/overlay/lib/python3.7/site-packages/skbuild/setuptools_wrap.py", line 560, in setup
      cmkr = cmaker.CMaker(cmake_executable)
    File "/tmp/pip-build-env-eoujog_o/overlay/lib/python3.7/site-packages/skbuild/cmaker.py", line 95, in __init__
      self.cmake_version = get_cmake_version(self.cmake_executable)
    File "/tmp/pip-build-env-eoujog_o/overlay/lib/python3.7/site-packages/skbuild/cmaker.py", line 82, in get_cmake_version
      "Problem with the CMake installation, aborting build. CMake executable is %s" % cmake_executable)
  Traceback (most recent call last):
  
  Problem with the CMake installation, aborting build. CMake executable is cmake
  ----------------------------------------
  ERROR: Failed building wheel for opencv-contrib-python
Failed to build opencv-contrib-python
ERROR: Could not build wheels for opencv-contrib-python which use PEP 517 and cannot be installed directly

I have already tried the following sources but nothing seems to help:

error-could-not-build-wheels-for-opencv-python-which-use-pep-517-and-cannot-be

Python OpenCV installation error

opencv-contrib-python

how-to-install-python-opencv-on-raspberry-pi

python3 --version Python 3.5.3

pip3 --version pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can download opencv-contrib-python for Rasberry Pi here.

Then use pip install opencv_contrib_python-4.5.1.48-cp37-cp37m-manylinux2014_aarch64.whl


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...