Python更换国内镜像源

更换镜像源之后,包下载飞一般的速度!
镜像地址替换
场景:解决包下载慢的问题
永久换源
清华源
1 | pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple |
会提示写入~/.config/pip/pip.conf
写入配置(Mac下)
其他源
阿里源: https://mirrors.aliyun.com/pypi/simple/
腾讯源: http://mirrors.cloud.tencent.com/pypi/simple
豆瓣源: http://pypi.douban.com/simple/
恢复默认源
1 | pip config unset global.index-url |
临时换源
1 | pip install 包名 -i https://pypi.tuna.tsinghua.edu.cn/simple |
- 本文标题:Python更换国内镜像源
- 创建时间:2022-12-15 00:42:24
- 本文链接:p/57739.html
- 版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
评论