【python】pip的配置
参考链接:https://www.runoob.com/w3cnote/pip-cn-mirror.html
pip指定镜像:
pip install pandas -i https://pypi.douban.com/simple
pip install pandas --trusted-host 192.168.1.224 -i http://192.168.1.224:30080
几个常用镜像:
豆瓣镜像 https://pypi.douban.com/simple
阿里镜像 https://mirrors.aliyun.com/pypi/simple
设置镜像
Linux/Mac os 环境中,配置文件位置在 ~/.pip/pip.conf(如果不存在创建该目录和文件)
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
查看当前配置
$ pip3 config list
global.index-url='https://pypi.tuna.tsinghua.edu.cn/simple'
install.trusted-host='https://pypi.tuna.tsinghua.edu.cn'
可以看到已经成功修改了镜像。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步