ubuntu18 pip換源


參考1
參考2

永久修改

創建pip.conf文件

mkdir ~/.pip
cd ~/.pip
touch pip.conf

編輯pip.conf文件
sudo gedit ~/.pip/pip.conf

寫入豆瓣源

[global] 
index-url = http://pypi.douban.com/simple 
[install] 
trusted-host=pypi.douban.com

寫入阿里源

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com

pip命令換源(暫時)

  • 阿里雲
    pip install -i http://mirrors.aliyun.com/pypi/simple 包名
  • 清華源
    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple 包名


免責聲明!

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



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