pip使用国内镜像源
默认情况下pip使用的是国外的镜像源,在下载的时候速度非常慢。
可以直接在pip命令中使用-i参数来指定镜像地址
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
这种只对当前安装对命令有用,如果需要全局修改,则需要修改配置文件
在Linux环境中,配置文件在 ~/.pip/pip.conf(如果不存在创建该目录和文件)
mkdir ~/.pip
vim ~/.pip/pip.conf
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
查看镜像地址
pip config list
global.index-url='https://pypi.tuna.tsinghua.edu.cn/simple'
install.trusted-host='https://pypi.tuna.tsinghua.edu.cn'
windows下当前对用户目录下(C:\Users\xx\pip,xx 表示当前使用对用户,比如张三)创建一个 pip.ini在pip.ini文件中输入以下内容:
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn
其他国内镜像源
● 中国科学技术大学 : https://pypi.mirrors.ustc.edu.cn/simple
● 豆瓣:http://pypi.douban.com/simple/
● 阿里云:http://mirrors.aliyun.com/pypi/simple/
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本