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

一、安装错误——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

你可能感兴趣的:(woking是ing~啦,webpack,python,opencv)