安裝 Anaconda 的正確姿勢


下面以 Anaconda2 安裝為例, 說明如何更加流暢的使用 Conda

Install Anaconda2

安裝 Anaconda2(從清華源下載比較快)

wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda2-5.1.0-Linux-x86_64.sh

bash  Anaconda2-5.1.0-Linux-x86_64.sh

配置Conda下載源為清華源

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

配置 conda 之后一定要配置 pip, 下載速度用過的都知道:)

pip 配置

pypi 鏡像使用幫助

臨時使用

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple XXX
注意,simple 不能少, 是 https 而不是 http

設為默認

修改

 ~/.config/pip/pip.conf (Linux)
 
%APPDATA%\pip\pip.ini (Windows 10)
windows 修改沒法使用的原因是, 隱藏了 txt 拓展名, 
創建的實際上是 pip.ini.txt, 點擊 "查看" -> 勾選 "文件擴展名", 將文件名修改為  pip.ini  即可


$HOME/Library/Application Support/pip/pip.conf (macOS) (沒有就創建一個)

修改 index-url至tuna,例如

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

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


免責聲明!

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



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