使用命令修改Python的PIP源


使用命令修改PIP源有两种方法:

1. 临时修改

示例:使用清华源安装numpy

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy

2. 永久修改

示例:将pip源永久替换为阿里,并使用新源安装numpy

# 配置源
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

# 安装numpy
pip install numpy 

附:国内常用源

# 清华源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 阿里源
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
# 腾讯源
pip config set global.index-url http://mirrors.cloud.tencent.com/pypi/simple
# 豆瓣源
pip config set global.index-url http://pypi.douban.com/simple/


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM