pip清華鏡像源使用方法總結


臨時使用

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

注意,simple 不能少, 是 https 而不是 http

設為默認

修改

 ~/.config/pip/pip.conf (Linux)

 C:\Users\xxxxx\pip\pip.ini (Windows 10)

 $HOME/Library/Application Support/pip/pip.conf (macOS)

(沒有就創建一個)

修改 index-url

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

pip 和 pip3 並存時,只需修改 ~/.pip/pip.conf

或者終端輸入

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM