python 安装 opencv-python 卡住(Running setup.py bdist_wheel for opencv-python ... )

问题:

pip3 install opence-python 会在Running setup.py bdist_wheel for opencv-python ... 卡住。现象如下:

pip3 install opencv-python
Collecting opencv-python
  Using cached https://files.pythonhosted.org/packages/c4/e2/27a153e27b98410cf5a871096a8baf98dd642e6685d3ebe7abd9edc8d51a/opencv-python-4.5.5.62.tar.gz
Collecting numpy>=1.13.3 (from opencv-python)
  Using cached https://files.pythonhosted.org/packages/51/60/3f0fe5b7675a461d96b9d6729beecd3532565743278a9c3fe6dd09697fa7/numpy-1.19.5.zip
Building wheels for collected packages: opencv-python, numpy
  Running setup.py bdist_wheel for opencv-python ...

解决方法:

pip3 install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/a4/6d/6463d49a933f547439d6b5b98b46af8742cc03ae83543e4d7688c2420f8b/pip-21.3.1-py3-none-any.whl (1.7MB)
    100% |################################| 1.7MB 196kB/s 
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr
Successfully installed pip-21.3.1
root@localhost:/home/share/CNStream/python/samples# pip install opencv-python
Collecting opencv-python
  Downloading opencv_python-4.5.5.62-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (39.0 MB)
     |################################| 39.0 MB 58 kB/s             
Collecting numpy>=1.13.3
  Downloading numpy-1.19.5-cp36-cp36m-manylinux2014_aarch64.whl (12.4 MB)
     |################################| 12.4 MB 532 kB/s            
Installing collected packages: numpy, opencv-python
Successfully installed numpy-1.19.5 opencv-python-4.5.5.62
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

C:\Users\SZUT>pip3 install opencv-contrib-python -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com Collecting opencv-contrib-python Downloading http://mirrors.aliyun.com/pypi/packages/ef/51/3ceb85ecff5f26994b7aae2922b1aa38148dbfe88cab13d63bc6facbac88/opencv-contrib-python-4.11.0.86.tar.gz (150.6MB) 100% |████████████████████████████████| 150.6MB 6.6MB/s Requirement already satisfied: numpy>=1.13.3 in c:\users\szut\appdata\local\programs\python\python36\lib\site-packages (from opencv-contrib-python) Building wheels for collected packages: opencv-contrib-python Running setup.py bdist_wheel for opencv-contrib-python ... error Complete output from command c:\users\szut\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\SZUT\\AppData\\Local\\Temp\\pip-build-ewyk_w3w\\opencv-contrib-python\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\SZUT\AppData\Local\Temp\tmpr4tloixopip-wheel- --python-tag cp36: Traceback (most recent call last): File "c:\users\szut\appdata\local\programs\python\python36\lib\site-packages\skbuild\setuptools_wrap.py", line 613, in setup cmkr = cmaker.CMaker(cmake_executable) File "c:\users\szut\appdata\local\programs\python\python36\lib\site-packages\skbuild\cmaker.py", line 146, in __init__ self.cmake_version = get_cmake_version(self.cmake_executable) File "c:\users\szut\appdata\local\programs\python\python36\lib\site-packages\skbuild\cmaker.py", line 103, in get_cmake_version ) from err Problem with the CMake installation, aborting build. CMake executable is cmake ---------------------------------------- Failed building wheel for opencv-contrib-python Running setup.py clean for opencv-contrib-python Failed to build opencv-contrib-python Installing collected packages: opencv-contrib-python Running setup.
最新发布
03-23
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值