Python,ERROR: No matching distribution found for cv2,ERROR: No matching distribution found for PIL

文章目录

Python

cv2

Python做一些图片,视频处理时,需要用到cv2库函数。但通过命令行安装cv2时,却会遇到如下错误。

# pip3 install cv2
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
ERROR: Could not find a version that satisfies the requirement cv2 (from versions: none)
ERROR: No matching distribution found for cv2

遇到这个错误换个名字安装就好了。

pip3 install opencv-python
# pip3 install opencv-python
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: opencv-python in d:\software\python\python3\lib\site-packages (4.2.0.32)
Requirement already satisfied: numpy>=1.14.5 in d:\software\python\python3\lib\site-packages (from opencv-python) (1.18.1)

我这里因为已经安装好了,所以没有重新下载安装x。

PIL

# pip3 install PIL
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)
ERROR: No matching distribution found for PIL

改为

pip3 install Pillow

可成功安装

# pip3 install Pillow
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting Pillow
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/88/6b/66f502b5ea615f69433ae1e23ec786b2cdadbe41a5cfb1e1fabb4f9c6ce9/Pillow-7.0.0-cp37-cp37m-win_amd64.whl (2.0 MB)
     |███████████▌                    | 727 kB 3.3 MB/s eta 0:00:01
     |████████████████████████████████| 2.0 MB
3.3 MB/s
Installing collected packages: Pillow
Successfully installed Pillow-7.0.0

安装成功。

发布了4 篇原创文章 · 获赞 0 · 访问量 82

猜你喜欢

转载自blog.csdn.net/qq_43398793/article/details/105044764