一文教你彻底解决Python包下载慢问题
python默认使用的是国外镜像,有时候下载非常慢,最快的办法就是在下载命令中增加国内源:
常用的国内源如下:
清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云: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+国内源
示例:
pip install requests -i https://pypi.tuna.tsinghua.edu.cn/simple
永久使用pip+国内源
示例:
# 永久设置阿里云的国内源 pip config set global.trusted-host mirrors.aliyun.com pip config set global.index-url https://mirrors.aliyun.com/simple # 永久设置清华大学的国内源 pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/
其他常用的pip命令
pip list 查看已安装包列表 pip install numpy 直接安装包 pip install numpy==1.11.0 安装指定版本为1.11.0的numpy包 pip install --upgrade numpy 升级包 pip uninstall numpy 卸载包
Pycharm中修改库下载源
在setting中按如下路径打开包下载
点击“+”
在Available Packages 对话框中,点击Manage Respositories
点击"+" 添加国内源路径即可
总结
到此这篇关于如何彻底解决Python包下载慢问题的文章就介绍到这了,更多相关Python包下载慢问题解决内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
相关文章
集调试共享及成本控制Prompt工具PromptLayer使用指南
这篇文章主要介绍了集调试共享及成本控制Prompt工具PromptLayer使用指南,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪2023-03-03Python+matplotlib+numpy实现在不同平面的二维条形图
这篇文章主要介绍了Python+matplotlib+numpy实现在不同平面的二维条形图,具有一定借鉴价值,需要的朋友可以参考下2018-01-01
最新评论