简体   繁体   English

无法在 Python 3.9 上使用 pip 安装 open cv

[英]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.安装 opencv 时出现此错误。 I have upgraded my pip and I am currently using Python 3.9.我已经升级了我的 pip,我目前正在使用 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.我在这里下载现代机器学习库(TensorFlow,sci-kit learn)时遇到了同样的问题,所以看到 TensorFlow 文档(官方)它表明我们应该安装 python 3.3-3.8。 I tried that and fortunately, it worked.我试过了,幸运的是,它奏效了。 Hope it works for you!希望这对你有用! So according to me, you should also install python 3.8所以据我说,你还应该安装 python 3.8

Note the opencv project readme does not yet state support for Python 3.9请注意, opencv 项目自述文件尚未说明对 Python 3.9 的支持

Supported Python versions Python 3.x compatible pre-built wheels are provided for the officially supported Python versions (not in EOL):支持的 Python 版本为官方支持的 Python 版本(不在 EOL 中)提供了与 Python 3.x 兼容的预构建轮子:

  • 3.6 3.6
  • 3.7 3.7
  • 3.8 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.在 Windows 上,请确保安装了Visual C++ Redistributable 2015 If you are using older Windows version than Windows 10 and latest system updates are not installed, Universal C Runtime might be also required.如果您使用的是比 Windows 10 更旧的 Windows 版本并且未安装最新的系统更新,则可能还需要Universal C Runtime

Alternatively, you can try downloading an unofficial wheel for opencv (and other dependencies) for Python 3.9 and installing from wheel files或者,您可以尝试下载用于 Python 3.9 的 opencv(和其他依赖项)的非官方轮子从轮子文件安装

right now openCV is not supporting python 3.9现在 openCV 不支持 python 3.9

its better to use earlier version of python, like 3.5 so everything is in original and stable最好使用早期版本的python,比如3.5,所以一切都是原始和稳定的

Python 3.9 is supported in the latest version of opencv.最新版本的 opencv 支持 Python 3.9。 source 来源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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