Ⅲ只小猪 发表于 2021-5-5 07:00:21

pip换源指南

有时候用pip下载一些模块,就比如pip install pygame,会遇到因下载速度太慢而模块安装失败的情况,这时可以通过换源操作来解决。1.   pip换源
pip临时换源:
pip install 模块名 -i 下载源
比如:
pip install pygame -i https://mirrors.aliyun.com/pypi/simple

pip永久换源:
pip config set global.index-url 下载源
比如:
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple

2.   常用的国内pip源,下载速度都很快豆瓣:
https://pypi.douban.com/simple

清华大学:
https://pypi.tuna.tsinghua.edu.cn/simple

阿里云:
https://mirrors.aliyun.com/pypi/simple

中国科技大学:
https://pypi.mirrors.ustc.edu.cn/simple

腾讯云:
https://mirrors.cloud.tencent.com/pypi/simple

3.   pip默认官方源如果永久修改了下载源,想换回来,请用官方的pip下载源:
https://pypi.python.org/simple

页: [1]
查看完整版本: pip换源指南