1. Conda Installation in Ubuntu

# install curl first
sudo apt-get install curl

# get the anaconda package
curl -O https://repo.anaconda.com/archive/Anaconda2-5.3.1-Linux-x86_64.sh
# or use this link
curl -O https://repo.continuum.io/archive/Anaconda2-5.3.1-Linux-x86_64.sh

After you download this package, just run it to install anaconda.

bash Anaconda2-5.3.1-Linux-x86_64.sh

To make the changes take effect, close and then re-open your Terminal window. Then you can conda to test it.

2. Command Lines

# if command not found: conda
export PATH=~/anaconda2/bin:$PATH

# create
conda create -n env_name python=2 ipython numpy

# add package
conda install --name env_name scipy

# update package
conda update pkg_name

# activate
source ~/anaconda3/bin/activate test_env
source activate test_env
conda activate test_env

# deactivate
source deactivate test_env

# clone
conda create -n test_env_2 -clone test_env

# check list of envs
conda info --envs

# remove
conda env remove -n test_env_2

# use user channel
conda install pytorch torchvision cuda80 -c channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

Offline Operation

You should use a combination of both answers.

conda install opencv --use-index-cache

to let conda check for dependencies and compatibility issues.

But keep using conda (not pip) for the installation (if you don’t have serious reasons not to stay in the initial framework) [wasn’t the reason using conda as package manager because pip couldn’t’t provide you those opportunities and flexibility?] You can download the *.tar.bz2 here.

conda install opencv-3.3.0-py36_200.tar.bz2

Conda Packages

  新装 Conda 需要安装的包以下作为参考:

conda install ipython numpy scipy pandas scikit-learn jupyter matplotlib seaborn tensorflow keras pytorch mxnet gcc
conda install -c conda-forge lightgbm
conda install -c anaconda joblib
conda install -c conda-forge tqdm
conda install -c conda-forge jieba
conda install -c anaconda cython
conda install -c anaconda gensim
conda install -c conda-forge tensorflow