opencv / opencv-python

Automated CI toolchain to produce precompiled opencv-python, opencv-python-headless, opencv-contrib-python and opencv-contrib-python-headless packages.
https://pypi.org/project/opencv-python/
MIT License
4.43k stars 833 forks source link

pip3 install opencv-python on Raspberry PI 64 Bit OS beta fails #448

Closed hackebike closed 3 years ago

hackebike commented 3 years ago

I tried to install OpenCV on a Raspberry PI 4 running 64 bit OS beta. Kernel: Linux 5.10.11-v8+ opencv/opencv#1399 SMP PREEMPT Thu Jan 28 12:14:03 GMT 2021 aarch64 GNU/Linux. Python 3.7.3

I there a specific version that I should point to? Here is the error:

pip3 install opencv-python
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting opencv-python
  Downloading https://files.pythonhosted.org/packages/bb/08/9dbc183a3ac6baa95fabf749ddb531bd26256edfff5b6c2195eca26258e9/opencv-python-4.5.1.48.tar.gz (88.3MB)
    100% |████████████████████████████████| 88.3MB 6.2kB/s 
  Installing build dependencies ... error
  Complete output from command /home/pi/tflite1/tflite1-env/bin/python3 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-b3_jcvec --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple -- setuptools wheel scikit-build cmake pip "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64'" "numpy==1.19.3; python_version>='3.6' and sys_platform == 'linux' and platform_machine == 'aarch64'" "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64'" "numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64'" "numpy==1.19.3; python_version>='3.9' and platform_machine != 'aarch64'":
  Ignoring numpy: markers 'python_version == "3.6" and platform_machine != "aarch64"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.7" and platform_machine != "aarch64"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.8" and platform_machine != "aarch64"' don't match your environment
  Ignoring numpy: markers 'python_version >= "3.9" and platform_machine != "aarch64"' don't match your environment
  Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple, https://www.piwheels.org/simple
  Collecting setuptools
    Using cached https://files.pythonhosted.org/packages/15/0e/255e3d57965f318973e417d5b7034223f1223de500d91b945ddfaef42a37/setuptools-53.0.0-py3-none-any.whl
  Collecting wheel
    Using cached https://files.pythonhosted.org/packages/65/63/39d04c74222770ed1589c0eaba06c05891801219272420b40311cd60c880/wheel-0.36.2-py2.py3-none-any.whl
  Collecting scikit-build
    Using cached https://files.pythonhosted.org/packages/78/c9/7c2c7397ea64e36ebb292446896edcdecbb8c1aa6b9a1a32f6f67984c3df/scikit_build-0.11.1-py2.py3-none-any.whl
  Collecting cmake
    Using cached https://files.pythonhosted.org/packages/26/76/b6df98a03343160a27c449c2866d8b94d349be4a3a6632aaf49c8d27916b/cmake-3.18.4.post1.tar.gz
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
  Collecting pip
    Using cached https://files.pythonhosted.org/packages/fe/ef/60d7ba03b5c442309ef42e7d69959f73aacccd0d86008362a681c4698e83/pip-21.0.1-py3-none-any.whl
  Collecting numpy==1.19.3
  Collecting packaging (from scikit-build)
    Using cached https://files.pythonhosted.org/packages/3e/89/7ea760b4daa42653ece2380531c90f64788d979110a2ab51049d92f408af/packaging-20.9-py2.py3-none-any.whl
  Collecting distro (from scikit-build)
    Using cached https://files.pythonhosted.org/packages/25/b7/b3c4270a11414cb22c6352ebc7a83aaa3712043be29daa05018fd5a5c956/distro-1.5.0-py2.py3-none-any.whl
  Collecting pyparsing>=2.0.2 (from packaging->scikit-build)
    Using cached https://files.pythonhosted.org/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl
  Building wheels for collected packages: cmake
    Running setup.py bdist_wheel for cmake: started
    Running setup.py bdist_wheel for cmake: finished with status 'error'
    Complete output from command /home/pi/tflite1/tflite1-env/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-7ntk4vs3/cmake/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-3i_a92mq --python-tag cp37:
    Traceback (most recent call last):
      File "/tmp/pip-build-env-ix6w50uw/lib/python3.7/site-packages/skbuild/setuptools_wrap.py", line 560, in setup
        cmkr = cmaker.CMaker(cmake_executable)
      File "/tmp/pip-build-env-ix6w50uw/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-ix6w50uw/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)

    Problem with the CMake installation, aborting build. CMake executable is cmake

    ----------------------------------------
    Failed building wheel for cmake
    Running setup.py clean for cmake
  Failed to build cmake
  Installing collected packages: setuptools, wheel, pyparsing, packaging, distro, scikit-build, cmake, pip, numpy
    Running setup.py install for cmake: started
      Running setup.py install for cmake: finished with status 'error'
      Complete output from command /home/pi/tflite1/tflite1-env/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-7ntk4vs3/cmake/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-_cbs9upd/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-b3_jcvec --compile --install-headers /home/pi/tflite1/tflite1-env/include/site/python3.7/cmake:
      Traceback (most recent call last):
        File "/tmp/pip-build-env-ix6w50uw/lib/python3.7/site-packages/skbuild/setuptools_wrap.py", line 560, in setup
          cmkr = cmaker.CMaker(cmake_executable)
        File "/tmp/pip-build-env-ix6w50uw/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-ix6w50uw/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)

      Problem with the CMake installation, aborting build. CMake executable is cmake

      ----------------------------------------
  Command "/home/pi/tflite1/tflite1-env/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-7ntk4vs3/cmake/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-_cbs9upd/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-b3_jcvec --compile --install-headers /home/pi/tflite1/tflite1-env/include/site/python3.7/cmake" failed with error code 1 in /tmp/pip-install-7ntk4vs3/cmake/

  ----------------------------------------
Command "/home/pi/tflite1/tflite1-env/bin/python3 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-b3_jcvec --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple -- setuptools wheel scikit-build cmake pip "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64'" "numpy==1.19.3; python_version>='3.6' and sys_platform == 'linux' and platform_machine == 'aarch64'" "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64'" "numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64'" "numpy==1.19.3; python_version>='3.9' and platform_machine != 'aarch64'"" failed with error code 1 in None
skvark commented 3 years ago

First thing you must always do before installing these packages: update your pip. Please refer to the README file for more detailed install instructions. If that does not solve the problem, we can then check if there's an actual issue somewhere.

hackebike commented 3 years ago

I have the latest packages installed and pip3 is the latest one pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)

skvark commented 3 years ago

Your pip is outdated. Did you read the README?

Make sure that your pip version is up-to-date (19.3 is the minimum supported version): pip install --upgrade pip. Check version with pip -V. For example Linux distributions ship usually with very old pip versions which cause a lot of unexpected problems especially with the manylinux format.

Your pip is too old to recognize the manylinux2014 wheels. Please upgrade it. There is no issue in this repository.

hackebike commented 3 years ago

I thought that sudo apt install python3-pip would get the latest. Anyway did the upgrade and got version 21. I was in a virtual environment and it was still using the older one, installation was ok thx for the support