pip安装opencv-python失败Cannot unpack file,cannot detect archive format等常见错误

使用pip install直接安装时下载速度慢,且容易超时(Read timed out)

pip install opencv-python

错误如下:

ERROR: Exception:
socket.timeout: The read operation timed out

(原始是因为直接下载会被墙)

解决方案是换用国内镜像清华源:

pip install https://pypi.tuna.tsinghua.edu.cn/simple

此时如果不出意外则会提示安装成功
Successfully installed numpy xxxxx

如果还继续出现如下之类错误:
ERROR: Cannot unpack file C:\User…; charset=u
tf-8); cannot detect archive format
ERROR: Cannot determine archive format of C:\Users…

则再次键入:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn opencv-python

则安装成功:

Successfully installed numpy-xxxxx opencv-python-xxxx

发布了1 篇原创文章 · 获赞 2 · 访问量 55

猜你喜欢

转载自blog.csdn.net/qq_46003255/article/details/104286665
今日推荐