ERROR: Cannot determine archive format of /tmp/pip-req-build-2uc6o_he 解决方案

1. 问题处理

当我们更换镜像源进行pip 安装时,可能会出现报错:ERROR: Cannot determine archive format of :XXXXXXXXXX
比如我刚开始安装tf2.0:

pip install https://pypi.douban.com/simple tensorflow==2.0.0

出现了上面的错误,下面我们只需要改成如下即可:

pip install -i https://pypi.douban.com/simple --trusted-host pypi.douban.com tensorflow==2.0.0

通过设置 --trusted-host pypi.douban.com 信任该镜像源。

2. 其他常用镜像源

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

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

清华大学  https://pypi.tuna.tsinghua.edu.cn/simple

中科大  http://pypi.mirrors.ustc.edu.cn/simple

网易云  https://mirrors.163.com/pypi/simple

当我们用其他源进行安装时,出现上面问题时。同样可以使用这种解决方法:

# 以清华源为例
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn 模块名

3. 更多问题请参考

清华镜像快速安装各种python库

ubantu系统下更换镜像源(阿里|清华|中科大|网易)

pip安装matplotlib

猜你喜欢

转载自blog.csdn.net/wjinjie/article/details/107225198