安装 opencv-python 出现Command “python setup.py egg_info“ failed with error code 1 in /tmp/pip-build-npa
安装 opencv-python 出现Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-npaou88f/numpy/sudo pip3 install opencv-python或者 pip3 install opencv-python出现错误:Collecting opencv-pytho
安装 opencv-python 出现
Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-npaou88f/numpy/
sudo pip3 install opencv-python 或者 pip3 install opencv-python
出现错误:
Collecting opencv-python
Downloading https://files.pythonhosted.org/packages/30/46/821920986c7ce5bae5518c1d490e520a9ab4cef51e3e54e35094dadf0d68/opencv-python-4.4.0.46.tar.gz (88.9MB)
100% |████████████████████████████████| 88.9MB 10kB/s
Collecting numpy>=1.13.1 (from opencv-python)
Downloading https://files.pythonhosted.org/packages/c5/63/a48648ebc57711348420670bb074998f79828291f68aebfff1642be212ec/numpy-1.19.4.zip (7.3MB)
100% |████████████████████████████████| 7.3MB 78kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-build-npaou88f/numpy/setup.py”, line 68
f"NumPy {VERSION} may not yet support Python "
^
SyntaxError: invalid syntax
----------------------------------------
Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-npaou88f/numpy/
如图:
本机VM12+Ubuntu16+Anaconda,(python3.6是安装Anaconda时自带的)。
试了多种方法(其中主要参考文章如下),但任未解决:
1、 Python3安装turtle提示错误:Command “python setup.py egg_info” failed with error code 1
2、 解决 Command “python setup.py egg_info” failed with error code 1 问题
3、 【python】错误SyntaxError: invalid syntax的解决方法总结
于是想到可能是某个地方不匹配,查看了pip和pip3的安装和路径,如下:
输入 python3 -m pip3 list 发现没有pip3
python3 -m pip list 发现有pip,而使用pip3 install 出现错误
于是改成
sudo pip install opencv-python
完成
由于刚开始接触tensorflow,按各种百度教程来安装环境。新手只是从网页上拷贝命令,没有注意到这个重要的小细节,希望本文能够给予同行以借鉴与参考。
更多推荐
所有评论(0)