我正试图在macOS Catalina的MacBook Pro上设置一个名为deeplearning
的虚拟环境,用于深度学习项目:-)
在deeplearning
虚拟环境中,我确实pip install opencv-python
但是这会引发一个错误,我不理解。。。我怎么修理它?我是不是忽略了什么
查看整个错误输出的最后一位,它似乎试图将不同的numpy
版本与特定的python
版本相匹配Python 3.9
不在其中。这就是问题所在吗?我是否应该恢复到版本Python 3.8
我安装了python@3.9
和numpy
和brew
谢谢
砂光机
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: /Users/swvanderlaan/.virtualenvs/deeplearning/bin/python /Users/swvanderlaan/.virtualenvs/deeplearning/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/kc/c5rw4cb94c1c149gsm2ygfc00000gn/T/pip-build-env-mudxxq4k/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 (4098 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
[I could not post everything due to the character limit.]
ERROR: Command errored out with exit status 1: /Users/swvanderlaan/.virtualenvs/deeplearning/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kc/c5rw4cb94c1c149gsm2ygfc00000gn/T/pip-install-we6wxt_t/numpy/setup.py'"'"'; __file__='"'"'/private/var/folders/kc/c5rw4cb94c1c149gsm2ygfc00000gn/T/pip-install-we6wxt_t/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 /private/var/folders/kc/c5rw4cb94c1c149gsm2ygfc00000gn/T/pip-record-wdchzme9/install-record.txt --single-version-externally-managed --prefix /private/var/folders/kc/c5rw4cb94c1c149gsm2ygfc00000gn/T/pip-build-env-mudxxq4k/overlay --compile --install-headers /private/var/folders/kc/c5rw4cb94c1c149gsm2ygfc00000gn/T/pip-build-env-mudxxq4k/overlay/include/site/python3.9/numpy Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/swvanderlaan/.virtualenvs/deeplearning/bin/python /Users/swvanderlaan/.virtualenvs/deeplearning/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/kc/c5rw4cb94c1c149gsm2ygfc00000gn/T/pip-build-env-mudxxq4k/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.
和更新。这扩展到安装:scipy
、scikit-learn
和scikit-image
-它们都依赖于numpy
。它也与pip3 install numpy
一起安装
问题是
Python 3.9
只是有几个漏洞,看起来没有可用于OpenCV
的二进制软件包。所以pip
正试图从源代码处编译它,这显然失败了,因为它有许多依赖项我建议您现在就安装
Python 3.8
,并在几周/几个月内升级到Python 3.9
,届时pip
上的所有通用软件包都可用相关问题 更多 >
编程相关推荐