• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

pip install opencv-python报错和相应解决办法

武飞扬头像
封印师请假去地球钓鱼
帮助1

一、安装错误——pip install opencv-python报错

错误描述: 

Please check the install target is valid and see CMake's output for more information.
  ----------------------------------------
  ERROR: Failed building wheel for opencv-python
Failed to build opencv-python
ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects  

原因分析:

        原因是使用pip install opencv-python命令安装的是最新版本,python3.6不支持。所以找一个python3.6支持的版本。如opencv-python==4.3.0.38

解决方案

pip install -i https://pypi.douban.com/simple/ pip install opencv-python==4.3.0.38

二、缺失包——python使用国内镜像安装包

首先下载外网文件速度很慢,这里给出国内源地址

国内源地址:
清华:https://pypi.tuna.tsinghua.edu.cn/simple

阿里云:https://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

华中理工大学:http://pypi.hustunique.com/

山东理工大学:http://pypi.sdutlinux.org/ 

豆瓣:http://pypi.douban.com/simple/

新版ubuntu要求使用https源,要注意。

解决方法:

  1. # win R打开cmd命令,切换安装文件夹。

  2. # 一般用法

  3. pip3 install requests

  4. # 加-i用法

  5. pip install opencv-python==4.5.5.62 -i https://pypi.tuna.tsinghua.edu.cn/simple requests

三、其余问题(后续有补充在评论区)

错误:ERROR: Cannot uninstall 'imageio'. It is a distutils installed project and thus we cannot         accurately determine which files belong to it which would lead to only a partial uninstall.
处理方法:在pip安装时,不直接采用pip install imageio,而用pip install --ignore-installed imageio就完美地解决了!用这个语句安装之后,pip list后发现还没有moviepy。再pip install moveiepy一下就好了。
参考https://blog.csdn.net/CSUWoOd/article/details/92066331

错误:Could not find a version that satisfies the requirement cv2 (from versions: )
处理方法:然后我就去安装opencv-python包,打开终端:键盘上的窗口键 R,直接在目录后面输入:pip install opencv-python,等待安装完成即可。
参考:https://blog.csdn.net/lq18804095672/article/details/105096231

错误:WARNING: You are using pip version 19.1.1, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
解决方法:在命令操作窗口输入python -m pip install --upgrade pip
参考:https://zhuanlan.zhihu.com/p/127062086

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhgcegka
系列文章
更多 icon
同类精品
更多 icon
继续加载