下載安裝文件
清華大學開源軟件鏡像站:下載地址
準備安裝文件
在網頁中找到對應的安裝文件,如Anaconda3-5.3.1-Linux-x86_64.sh
移動安裝文件到用戶根目錄下
開始安裝Anaconda3
安裝腳本
sudo chmod +x ~/Anaconda3-5.3.1-Linux-x86_64.sh
~/Anaconda3-5.3.1-Linux-x86_64.sh
# 稍後會出現很多提示信息,可以長按空格鍵直接跳過
安裝選項
下面的安裝選項中,省略號代表程序輸出的無關信息,可忽略
Do you accept the license terms? [yes|no]
[no] >>> yes
..................................................
[/home/ai-machine/anaconda3] >>> Anaconda3
..................................................
Do you wish the installer to initialize Anaconda3 in your /home/ai-machine/.bashrc ? [yes|no]
[no] >>> no
..................................................
Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]
>>> no
環境變量
在用戶根目錄下,找到.bashrc文件並打開,在最後添加下面三行文本,保存並退出
# added by Anaconda3 5.3.1 installer
export PATH="$HOME/Anaconda3/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/Anaconda3/lib:$LD_LIBRARY_PATH"
環境優化
#針對conda的下載,在控制檯運行以下命令添加下載通道即可
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
#針對pip的下載,把安裝命令修改爲以下樣例即可,例如:
pip install ${PACKAGE_NAME} -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/
運行測試
如果能顯示以下信息,則表明安裝成功
Python 3.7.0 (default, Jun 28 2018, 13:15:42)
[GCC 7.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>