一、背景
由于python再下载包时,下载时容易出现超时,等各种问题,
原因:由于Python库的服务器都在国外,国内下载是速度普遍会很慢,所以需要配置一个镜像源来加快下载速度
二、解决方案
方案一
配置国内镜像源
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
2. 永久镜像源
pip install --upgrade pip pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
方案二
Pycharm中更改镜像源

然后点击“+”添加镜像源地址(建议先把本地镜像源删除)

参考博客
Pycharm中更改镜像源_weimingchao的博客-CSDN博客_pycharm设置镜像源
Python配置镜像源__的博客-CSDN博客_python 镜像设置
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/173788.html原文链接:https://javaforall.net
