Python 安装opencv-python出现错误:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting opencv-python==3.4.10.37 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/46/3e/1b61ed8e501c5d44239602c2e83d2ae43d01f9ec0a570c7cc43169c873bb/opencv-python-3.4.10.37.tar.gz (87.5MB) |████████████████████████████████| 87.5MB 11.8MB/s Installing build dependencies ... done Getting requirements to build wheel ... error ERROR: Command errored out with exit status 1: command: /Users/mcj/anaconda3/envs/py2/bin/python /Users/mcj/anaconda3/envs/py2/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/_q/nw2x15wx38l8hngtj0x2h3rw0000gn/T/tmpD3tJeD cwd: /private/var/folders/_q/nw2x15wx38l8hngtj0x2h3rw0000gn/T/pip-install-67Cgcp/opencv-python Complete output (22 lines): Traceback (most recent call last): File "/Users/mcj/anaconda3/envs/py2/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 257, in <module> main() File "/Users/mcj/anaconda3/envs/py2/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 240, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/Users/mcj/anaconda3/envs/py2/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 91, in get_requires_for_build_wheel return hook(config_settings) File "/private/var/folders/_q/nw2x15wx38l8hngtj0x2h3rw0000gn/T/pip-build-env-RJWX8u/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 146, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) File "/private/var/folders/_q/nw2x15wx38l8hngtj0x2h3rw0000gn/T/pip-build-env-RJWX8u/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 127, in _get_build_requires self.run_setup() File "/private/var/folders/_q/nw2x15wx38l8hngtj0x2h3rw0000gn/T/pip-build-env-RJWX8u/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 243, in run_setup self).run_setup(setup_script=setup_script) File "/private/var/folders/_q/nw2x15wx38l8hngtj0x2h3rw0000gn/T/pip-build-env-RJWX8u/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 142, in run_setup exec(compile(code, __file__, 'exec'), locals()) File "setup.py", line 448, in <module> main() File "setup.py", line 99, in main % {"ext": re.escape(sysconfig.get_config_var("EXT_SUFFIX"))} File "/Users/mcj/anaconda3/envs/py2/lib/python2.7/re.py", line 210, in escape s = list(pattern) TypeError: 'NoneType' object is not iterable ---------------------------------------- ERROR: Command errored out with exit status 1: /Users/mcj/anaconda3/envs/py2/bin/python /Users/mcj/anaconda3/envs/py2/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/_q/nw2x15wx38l8hngtj0x2h3rw0000gn/T/tmpD3tJeD Check the logs for full command output. |
解决办法:
主要原因是Python 安装的OpenCV版本的问题,只需要改为:
pip install opencv-python==4.2.0.32
解决后:
|
1 2 3 4 5 6 7 8 9 |
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting opencv-python==4.2.0.32 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/56/ff/59c8c21163eafc63261d13792f8303ac45bcb0edd7b098f9f6b91fdbe215/opencv_python-4.2.0.32-cp27-cp27m-macosx_10_9_x86_64.whl (47.9MB) |████████████████████████████████| 47.9MB 367kB/s Collecting numpy>=1.11.1 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/09/96/84cf406fe7d589f3dba9fc0f737e65985a3526c6d8c783f02d4b5a10825d/numpy-1.16.6-cp27-cp27m-macosx_10_9_x86_64.whl (13.9MB) |████████████████████████████████| 13.9MB 11.0MB/s Installing collected packages: numpy, opencv-python Successfully installed numpy-1.16.6 opencv-python-4.2.0.32 |

马春杰杰



看答案+1,我也碰到了
收到
我是来看答案的,我也碰到了
好的
我也遇到这个问题
我是来看答案的,我也碰到了
我是来看答案的,我也碰到了
我是来看看的
我是来看解答的哈哈哈1111
我是来看解答的哈哈哈
方法可以
感谢分享
感谢理解
看看
看看
看看
看看
看看
好好学习,天天向上。加油!!!
求可靠的解决办法
我来看看解决办法
好好学习,天天向上。加油!!!
多谢分享!!
学习一下
学习一下
nice 棒
不错,期望看看解决办法,谢谢。
看看楼主的解决方法
看看行不行
小气, 这也要评论? 我不信你没看过别人的解决方法
呃,你不想看可以不看的。这些方法也不是大街上随手捡来的,需要时间、精力。
每一篇文章都是我亲自尝试然后优化过的。你以为知识这么不值钱么?
居然评论、才能看。。。
因为伸手党太多了
好好学习,天天向上。加油!!!
遇到同样的问题
强啊,真的解决了
必须的
楼主nb,楼主nb,谢谢谢谢
厉害
太厉害了
6666666666666666666666666666666666厉害
厉害,解决了问题
6666666666666666666666666666666666厉害
6666666厉害了
优秀
厉害了
优秀
xiangkan我的天
OMG!!!我的天
xiangkan我的天
我的天
你们这是咋了?
omg我的天
omg我的天
xiangkan登陆可免验证码
很好很强大 为什么
学习学习
很好很强大 为什么 因为很强大