installation process
1 Download the installation package
official website
https://www.anaconda.com/download#downloads
2 Execute the installation
bash Anaconda3-2021.11-Linux-x86_64.sh
3 installation process
Enter+yes all the way, accept the license, specify the installation path and init , and then the installation is complete.
Verify that anaconda is installed successfully.
conda --version
or
conda -V
Create a virtual environment
conda create -n test python=3.7.5
Change the source of anaconda under linux
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
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/pkgs/pro
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
- show search path
conda config --set show_channel_urls yes
conda config --get channels
- show mirror channel
conda config --show channels
- To save the changes, enter the following command:
source ~/.bashrc
After completion, enter the command to view the configuration file
vim ~/.condarc
(if necessary) switch back to the default source
conda config --remove-key channels
pytorch official website
https://pytorch.org/get-started
Install pytorch
With the command:
conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0 cudatoolkit=11.6
Do not add: -c pytorch
,-c conda-forge
Do not use it:
conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0 cudatoolkit=11.6 -c pytorch -c conda-forge