使用命令修改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