Install anaconda
- Enter the official website of Anaconda:https://www.anaconda.com/
- Left click download
- Double left click the file after downloading,the result should be:
- Keep clicking next util this part:
Check add anaconda3 to my PATH environment varible
- Installation done
7. Check whether anaconda has been successfully installed:
Search cmd on the left bottom of screen
open cmd, typeconda
, conda has been successfully installed if it gives you like this:
Create conda environment
- Create a new environment named
tutorial
(setup python version as 3.6)
Successfully create:conda create -n tutorial python=3.6
Activate environment
- Activate environment
tutorial
Successfully activate:conda activate tutorial
Install jupyter notebook
- install
conda install jupyter
- open jupyter notebook
jupyter notebook
Install pytorch
- Enter the official website of pytorch:https://pytorch.org/
- Choose the version you need, then copy the installation command.
4. In cmd, activate the environment you would like to install pytorch into. Then enter the command you copied before.Here I use cpu version pytorch for an example:
conda install pytorch torchvision torchaudio cpuonly -c pytorch
- Check wether pytorch has been successfully installed:
The result should be like this if successfully installed:import torch torch.__version__
Replace channel(If need)
Mirror channel is used when you can’t download some package due to the fire wall of China.
- Create condarc file:
conda config --add channels r
- The condarc file should be in : /home/user/.condarc
- Find the file and open it, the content of the file should be like this:
- Use the content below to replace the content of condarc file:
channels: - defaults show_channel_urls: true channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2 custom_channels: conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud