我正在尝试建立一个虚拟环境,名为deeplearning,for,euh,一个深度学习项目:-)在我的MacBook Pro上,macOS Catalina。
在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由于字符限制,
无法发布所有内容。
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一起安装。
发布于 2020-11-02 19:41:01
问题是,Python 3.9只是几个薄弱环节,而且看起来OpenCV没有二进制包可用。因此,pip试图从源代码编译它,这显然失败了,因为它有许多依赖项。
我建议您现在安装Python 3.8,并在几周/几个月内升级到Python 3.9,届时所有常见的软件包都可以在pip上使用。
https://stackoverflow.com/questions/64614299
复制相似问题