天天看點

Ubuntu指令安裝anaconda

1、下載下傳anaconda

官網檢視版本

Ubuntu指令安裝anaconda

隻需要把下面連結對應的日期改,就可以下載下傳對應的版本了

下載下傳指令:

wget https://repo.anaconda.com/archive/Anaconda3-2018.12-Linux-x86_64.sh
           

2、安裝anaconda

切換到下載下傳路徑,執行那個安裝腳本就行

sudo bash Anaconda3-2018.12-Linux-x86_64.sh
           

安裝有些提示,自己看着做就行

Ubuntu指令安裝anaconda

預設安裝挺好的,

最後會問,是否安裝VS code,這個看個人選擇吧。

我安裝了vscode

環境變量配置,這裡預設是no,是以要看清楚,yes他就幫你配好環境,不用手動配了,我手快選了no

Ubuntu指令安裝anaconda

錯過也沒關系,執行上面提示的指令就行

echo ". /home/ubuntu/anaconda3/etc/profile.d/conda.sh" >> ~/.bashrc
source ~/.bashrc
           

配置成功後,可以看版本号了

Ubuntu指令安裝anaconda
Ubuntu指令安裝anaconda

附屬一些安裝小心得

ubuntu 預設自帶兩個版本的python,是以他們的pip也是分開的,如果想下載下傳numpy包給2.x的,要用pip2 install python-numpy

如果想安裝給3.x的,要用pip3 install python-numpy

注意要加python字首,其他依此類推

Anaconda 換源

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

檢視鏡像源

conda config --show channels
           

換源成功後進行更新

conda update --all
conda update -n base conda
           

删除鏡像源

換回預設源

conda config --remove-key channels
           

用pip 換源下載下傳,可以指令目标源

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python
           

常用的一些pip源

豆瓣(douban) http://pypi.douban.com/simple/

阿裡雲 http://mirrors.aliyun.com/pypi/simple/

中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/

清華大學 https://pypi.tuna.tsinghua.edu.cn/simple/

中國科學技術大學 http://pypi.mirrors.ustc.edu.cn/simple/

繼續閱讀