解决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
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步