Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install OpenCV python3.8

When I execute this command:

pip3 install opencv-python

I get the following error:

  Installing build dependencies ... error                            ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/lib/python3/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-z4c_sn6u/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel scikit-build cmake pip 'numpy==1.11.3; python_version=='"'"'3.5'"'"'' 'numpy==1.13.3; python_version=='"'"'3.6'"'"'' 'numpy==1.14.5; python_version=='"'"'3.7'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"''       cwd: None
  Complete output (22 lines):
  Ignoring numpy: markers 'python_version == "3.5"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.6"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.7"' don't match your environment
  Collecting setuptools
    Downloading setuptools-49.6.0-py3-none-any.whl (803 kB)
  Collecting wheel
    Downloading wheel-0.35.0-py2.py3-none-any.whl (24 kB)
  Collecting scikit-build
    Using cached scikit_build-0.11.1-py2.py3-none-any.whl (72 kB)
  Collecting cmake
    Using cached cmake-3.18.0.tar.gz (28 kB)
      ERROR: Command errored out with exit status 1:
       command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-95tsmt_u/cmake/setup.py'"'"'; __file__='"'"'/tmp/pip-install-95tsmt_u/cmake/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-95tsmt_u/cmake/pip-egg-info
           cwd: /tmp/pip-install-95tsmt_u/cmake/
      Complete output (5 lines):
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/tmp/pip-install-95tsmt_u/cmake/setup.py", line 7, in <module>
          from skbuild import setup
      ModuleNotFoundError: No module named 'skbuild'
      ----------------------------------------
  ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/lib/python3/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-z4c_sn6u/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel scikit-build cmake pip 'numpy==1.11.3; python_version=='"'"'3.5'"'"'' 'numpy==1.13.3; python_version=='"'"'3.6'"'"'' 'numpy==1.14.5; python_version=='"'"'3.7'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"'' Check the logs for full command output.

Same when I tried to install ecapture, I am using the latest python version

like image 909
Dmirty Trecenko Avatar asked Aug 14 '20 09:08

Dmirty Trecenko


2 Answers

Try to upgrade your pip with

pip install --upgrade pip

and then run the

pip install opencv-python
like image 190
Gautamrk Avatar answered Sep 20 '22 14:09

Gautamrk


Installation and Usage guide on pypi web site says

Pip install fails with ModuleNotFoundError: No module named 'skbuild'?

Since opencv-python version 4.3.0.*, manylinux1 wheels were replaced by manylinux2014 wheels. If your pip is too old, it will try to use the new source distribution introduced in 4.3.0.38 to manually build OpenCV because it does not know how to install manylinux2014 wheels. However, source build will also fail because of too old pip because it does not understand build dependencies in pyproject.toml. To use the new manylinux2014 pre-built wheels (or to build from source), your pip version must be >= 19.3.
Please upgrade pip with
pip install --upgrade pip

like image 37
zab Avatar answered Sep 20 '22 14:09

zab