0
点赞
收藏
分享

微信扫一扫

python配置国内镜像源

windows环境

1.新建php文件,文件里面建pip.text,后缀改成ini

python配置国内镜像源_php


2.打开,写入以下内容。重新运行cmd即可

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn # trusted-host 此参数是为了避免麻烦,否则使用的时候可能会提示不受信任



linux环境

cd ~/.pip   # 运行此命令切换目录
mkdir ~/.pip   没有改目录就创建
cd ~/.pip
touch pip.conf
vi ~/.pip/pip.conf
[global] 
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn # trusted-host 此参数是为了避免麻烦,否则使用的时候可能会提示不受信任


国内常用镜像源

清华大学:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
豆瓣:http://pypi.douban.com/simple/
举报

相关推荐

0 条评论