How to install Anaconda, modify environment variables and manage environment under Linux

1. The first step: install anaconda

Let's take Anaconda3-2020.02-Linux-x86_64.sh as an example: First, download the corresponding Anaconda3 version from the Tsinghua mirror source
insert image description hereand modify its permissions: chmod –R 777 Anaconda3-2020.02-Linux-x86_64.shbash Anaconda3-2020.02-Linux-x86_64.shconda init-all

Execute the installer: bash anaconda-xxx.sh

When you are asked to choose "yes" or "no", enter "yes"; then select yes all the way. In the end, "no module name conda" may appear, which is normal, don't worry. look down:
 

2. The second step: change/adjust the system environment PATH

First you should uninstall existing python modules, because it will be troublesome when you want to use python in anaconda.
module unload tool/python/3.5

Then you should reinitialize the conda environment:
…/username/anaconda3/bin/conda init --all
 

3. Step 3: Create an appropriate virtual python/pip workspace

Restart the terminal and use the following cmd:
conda create -n venv_name --clone venv_example --offline eg:
conda create –n py37 python=3.7
conda activate py37
cd py37/pkgs/
conda install py37
conda install *.tar.bz2
conda install *.conda

If there is no network (in the case of company R&D intranet), you can install the environment offline:
conda create –n py37 --offline
conda activate py37
cd py37/pkgs/
conda install python_version
conda install *.tar.bz2
conda install *.conda
 

3. Step 4: How to use conda to manage different environments

For example, one environment requires Python3.7, and another environment requires python3.8, you can pass:
conda create -name environment name 1 python=3.7
conda create -name environment name 1 python=3.9...

to achieve the purpose of multi-environment management.
Then conda info --env to view the virtual environment
conda activate environment name to enter the environment
conda deactivate to exit the environment
 


Install Anaconda/cuda/Cudnn/pytorch/tensorflow under windows (8/10/11), see my video installation tutorial at station b:

Fortunate to meet - the most complete, concise and easy-to-learn deep learning environment configuration tutorial at station b

Guess you like

Origin blog.csdn.net/weixin_49457347/article/details/126252218