解决PyCharm安装包慢问题


问题描述:使用PyCharm中pip安装包时特别慢。

解决方法:换成国内镜像源

方案一:指定镜像地址

pip 命令中添加 -i 参数指定镜像地址,如:

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

其他可用镜像地址包括:

# 清华镜像站
https://pypi.tuna.tsinghua.edu.cn/simple
# 中科大镜像站
https://pypi.mirrors.ustc.edu.cn/simple
# 豆瓣镜像站
http://pypi.douban.com/simple/

方案二:PyCharm中添加国内镜像站

第一步,PyCharm——File——Settings——定位到工程“Project:xxxx”——Project Interpreter——点击加号

第二步,点击Manage Repositories

第三步,添加镜像源

方案三:全局 pip 配置

Windows下:

# 新建文件并编辑 C:\Users\xxx\pip\pip.ini
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn

Linux/MacOS下:

# 新建文件并编辑 ~/.pip/pip.conf
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn

参考:

[1] pip 使用国内镜像源, RUNOOB.COM

[2] PyCharm解决安装慢的问题 更换pip源为国内源, CSDN, 魏有心


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM