Install Python on Your Linux OS
Install conda
How to run pytorch or tensorflow in the docker.
procedure
1 - install Vim, bunzip, net tools and wget
apt install vim
apt install bzip2
apt install net-tools
apt install wget
2 - change the yum source if you’d like:
vim /etc/apt/sources.list
You can follow the instructions step by step on https://blog.csdn.net/GenuineMonster/article/details/82716948
3 - install conda
- Download conda from https://www.anaconda.com/.
wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
- Installation
bash Anaconda3-2019.10-Linux-x86_64.sh
For more detail, please move to https://docs.continuum.io/anaconda/install/linux/.
Command pip
is not recommended for managing the python virtual environment. If you have to use command pip install
to add a package in your env, you’d better to change your python lib search path to make sure that the installed package will not affect other python envs.
4 - manage python environments
- create a python environment
conda create --name pytorch_1.3_CU_10 python=3.6
- switch to pytorch_1.3_CU_10
conda activate pytorch_1.3_CU_10
5 - install pytorch
- pytorch installation.
Please refer to pytorch official website: https://pytorch.org/get-started/locally/
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
- Verification
python pytorch_verification.py