简体   繁体   中英

Unable to install open cv using pip on Python 3.9

 ERROR: Command errored out with exit status 1: 'e:\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mmusa\\AppData\\Local\\Temp\\pip-install-z5zd5j52\\numpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\mmusa\\AppData\\Local\\Temp\\pip-install-z5zd5j52\\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\mmusa\AppData\Local\Temp\pip-record-wre2z2vk\install-record.txt' --single-version-externally-managed --prefix 'C:\Users\mmusa\AppData\Local\Temp\pip-build-env-zf5z8fdj\overlay' --compile --install-headers 'C:\Users\mmusa\AppData\Local\Temp\pip-build-env-zf5z8fdj\overlay\Include\numpy' Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'e:\python\python.exe' 'e:\python\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\mmusa\AppData\Local\Temp\pip-build-env-zf5z8fdj\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.

I get this error while installing opencv. I have upgraded my pip and I am currently using Python 3.9. Any help would be appreciated

I had the same problem here for downloading modern machine learning libraries(TensorFlow, sci-kit learn)So saw the TensorFlow documentation(official) it was indicating that we should python 3.3-3.8 for installing. I tried that and fortunately, it worked. Hope it works for you! So according to me, you should also install python 3.8

Note the opencv project readme does not yet state support for Python 3.9

Supported Python versions Python 3.x compatible pre-built wheels are provided for the officially supported Python versions (not in EOL):

  • 3.6
  • 3.7
  • 3.8

Without prebuilt wheels, you'll need to build it yourself. Make sure you have proper build tools installed on your system.

Also note:

on Windows, make sure you have Visual C++ redistributable 2015 installed. If you are using older Windows version than Windows 10 and latest system updates are not installed, Universal C Runtime might be also required.

Alternatively, you can try downloading an unofficial wheel for opencv (and other dependencies) for Python 3.9 and installing from wheel files

right now openCV is not supporting python 3.9

its better to use earlier version of python, like 3.5 so everything is in original and stable

Python 3.9 is supported in the latest version of opencv. source

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM