python安装opencv出现错误_Python:Ubuntu上使用pip安装opencv-python出现错误

在Ubuntu系统中尝试使用pip安装opencv-python时,遇到了Python 2.7已过期的警告,并且在安装过程中出现了错误。错误提示pip 21.0将不再支持Python 2.7,且在获取构建轮子的要求时发生了错误。安装过程中,系统尝试从https://pypi.tuna.tsinghua.edu.cn/simple下载并安装opencv-python的缓存包,但最终因类型错误而失败。
摘要由CSDN通过智能技术生成

1 ~$: pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple

2 DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.

3 Defaulting to user installation because normal site-packages is not writeable4 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple

5 Collecting opencv-python6 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a1/d6/8422797e35f8814b1d9842530566a949d9b5850a466321a6c1d5a99055ee/opencv-python-4.3.0.38.tar.gz (88.0 MB)

7 Installing build dependencies ... done

8 Getting requirements to build wheel ... error9 ERROR: Command errored out with exit status 1:10 command: /usr/bin/python /home/litterboy/.local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp8E6IcN11 cwd: /tmp/pip-install-SI_wRI/opencv-python12 Complete output (22lines):13 Traceback (most recent call last):14 File "/home/litterboy/.local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in

15 main()16 File "/home/litterboy/.local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 263, inmain17 json_out['return_val'] = hook(**hook_input['kwargs'])18 File "/home/litterboy/.local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 114, inget_requires_for_build_wheel19 return hook(config_settings)20 File "/tmp/pip-build-env-FfK60X/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 146, inget_requires_for_build_wheel21 return self._get_build_requires(config_settings, requirements=['wheel'])22 File "/tmp/pip-build-env-FfK60X/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 127, in_get_build_requires23 self.run_setup()24 File "/tmp/pip-build-env-FfK60X/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 243, inrun_setup25 self).run_setup(setup_script=setup_script)26 File "/tmp/pip-build-env-FfK60X/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 142, inrun_setup27 exec(compile(code, __file__, 'exec'), locals())28 File "setup.py", line 448, in

29 main()30 File "setup.py", line 99, inmain31 % {"ext": re.escape(sysconfig.get_config_var("EXT_SUFFIX"))}32 File "/usr/lib/python2.7/re.py", line 210, inescape33 s =list(pattern)34 TypeError: 'NoneType' objectis not iterable35 ----------------------------------------

36 ERROR: Command errored out with exit status 1: /usr/bin/python /home/litterboy/.local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp8E6IcN Check the logs for full command output.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值