解决linux 中pip下载超时的情况

可用镜像来解决问题。

pip install packageName -i https://pypi.tuna.tsinghua.edu.cn/simple   # -i 后面为国内镜像地址

其他常用pip源地址:
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/ 

更多地址可通过镜像地址来查看。

还不行的话,就加时间,形式如下:

pip install --default-timeout=10000 tensorflow==2.2.0

速度还是慢到发指的话,可以复制出来.whl文件的网址,在浏览器上下载下来whl文件,放到当前文件夹下,然后运行如下:

pip install tensorflow-2.2.0-cp37-cp37m-manylinux2010_x86_64.whl

done!

猜你喜欢

转载自blog.csdn.net/qq_36663518/article/details/107460605