i can't install opencv

asked 2020-10-27 02:50:12 -0600

updated 2020-10-27 02:56:33 -0600

berak gravatar image

.

pip install opencv-python
Collecting opencv-python
  Using cached opencv-python-4.4.0.44.tar.gz (88.9 MB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\gama\appdata\local\programs\python\python39\python.exe' 'c:\users\gama\appdata\local\programs\python\python39\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\gama\AppData\Local\Temp\pip-build-env-ykzi43np\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 (310 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
    Using cached setuptools-50.3.2-py3-none-any.whl (785 kB)
  Collecting wheel
    Using cached wheel-0.35.1-py2.py3-none-any.whl (33 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.2.post1-py3-none-win_amd64.whl (34.7 MB)
  Collecting pip
    Using cached pip-20.2.4-py2.py3-none-any.whl (1.5 MB)
  Collecting numpy==1.17.3
    Using cached numpy-1.17.3.zip (6.4 MB)
  Collecting packaging
    Using cached packaging-20.4-py2.py3-none-any.whl (37 kB)
  Collecting distro
    Using cached distro-1.5.0-py2.py3-none-any.whl (18 kB)
  Collecting pyparsing>=2.0.2
    Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
  Collecting six
    Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
  Using legacy 'setup.py install' for numpy, since package 'wheel' is not installed.
  Installing collected packages: setuptools, wheel, pyparsing, six, packaging, distro, scikit-build, cmake, pip, numpy
      Running setup.py install for numpy: started
      Running setup.py install for numpy: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: 'c:\users\gama\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\gama\\AppData\\Local\\Temp\\pip-install-e3vjvwac\\numpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\gama\\AppData\\Local\\Temp\\pip-install-e3vjvwac\\numpy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\gama\AppData\Local\Temp\pip-record-8o5scm7e\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\gama\AppData\Local\Temp\pip-build-env-ykzi43np\overlay' --compile --install-headers 'C:\Users\gama\AppData\Local\Temp\pip-build-env-ykzi43np\overlay\Include\numpy'
           cwd: C:\Users\gama\AppData\Local\Temp\pip-install-e3vjvwac\numpy\
      Complete output (277 lines):
      Running from numpy source directory.

      Note: if you need reliable uninstall behavior, then install
      with pip instead of using `setup.py install`:

        - `pip install .`       (from a git repo or downloaded source
                                 release)
        - `pip install numpy`   (last NumPy release on PyPi)


      blas_opt_info:
      blas_mkl_info:
      No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      customize MSVCCompiler
        libraries mkl_rt not found in ['c:\\users\\gama\\appdata\\local\\programs\\python\\python39\\lib', 'C:\\', 'c:\\users\\gama\\appdata\\local\\programs\\python\\python39\\libs']
        NOT AVAILABLE ...
(more)
edit retag flag offensive close merge delete

Comments

try to fall back to python 3.8,

this is not really an opencv problem, they don't maintain any pip binaries, and your main problem seems to be installing numpy

your 3.9 seems to have trouble finding a fitting numpy version, and tries to build it from scratch, from there on it all goes down ...)

berak gravatar imageberak ( 2020-10-27 03:05:02 -0600 )edit