安装cv2(opencv-python)遇到的一些问题

安装cv2(opencv-python)遇到的一些问题

1.1.首先在pycharm里面直接搜索cv2,显示no availble information,后面安装报错。

2.直接去终端安装,pip install opencv-python,反应很慢,显示访问过时。

3.换镜像源在终端安装,pip install Pyinstaller -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com,报错

Collecting opencv-python
  WARNING: The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'.
  ERROR: Could not find a version that satisfies the requirement opencv-python (from versions: none)
ERROR: No matching distribution found for opencv-python
WARNING: You are using pip version 19.2.3, however version 22.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

4.去掉3中trusted-host mirrors.aliyun.com,报错,并且要升级pip

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting opencv-python
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/7a/1c/e57fe138615c29b8d1442009057dd420c58d4773cb16112e914c9e7b47d8/opencv-python-4.6.0.66.tar.gz (90.3MB)
     |████████████████████████████████| 90.3MB 504kB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: numpy>=1.14.5; python_version >= "3.7" in e:\studying software\python\lib\site-packages (from opencv-python) (1.23.4)
Building wheels for collected packages: opencv-python
  Building wheel for opencv-python (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'e:\studying software\python\python.exe' 'e:\studying software\python\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\FANZHO~1\AppData\Local\Temp\tmpcpt_42_h'
       cwd: C:\Users\fanzhonglin\AppData\Local\Temp\pip-install-oovhi8pw\opencv-python
  Complete output (332 lines):后面报错省略。。。。
  Failed to build opencv-python
ERROR: Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 19.2.3, however version 22.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

5.更新pip pip install --upgrade pip setuptools wheel,报错ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: 'e:\\studying software\\python\\scripts\\pip.exe' Consider using the–user option or check the permissions.
6.修复pip python -m ensurepip
7.再更新pip python -m pip install --upgrade pip
8.更新成功后,直接pip install opencv-python,安装成功

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值