python pip anaconda conda 切換國內源(清華鏡像)


anaconda配置鏡像

Mac and Linux

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes

 Windows

  windows下,直接在user目錄中創建一個pip目錄,如:C:\Users\xx\pip,新建文件pip.ini,內容如下

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

 

pip配置鏡像 

Linux

修改 ~/.pip/pip.conf (沒有就創建一個), 修改 index-url至tuna,內容如下:

 

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

 

 Windows

直接在user目錄中創建一個pip目錄,如:C:\Users\xx\pip,新建文件pip.ini,內容如下

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

 

 

pip臨時鏡像

 

臨時使用:

 

可以在使用pip的時候加參數-i https://pypi.tuna.tsinghua.edu.cn/simple

 

例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple gevent,這樣就會從清華這邊的鏡像去安裝gevent庫。

 


免責聲明!

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



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