(1) First go to Anaconda official website: Anaconda , download the installation file:
(2) When installing, you only need to pay attention to setting the installation path. The installation path in this article is: D:\Anaconda3
. After installation, open the start menu and you can see the following startup items:
After opening, you will see on the left (base)
, indicating that the installation is successful, you can enter conda -V
to view the version number:
(3) Modify the path of the creation environment: first open Anaconda Navigator in the start menu, click File-Preferences-Configure Conda in the upper left corner, and modify it to the following information (created in advance D:\Anaconda3_Environments\envs
and D:\Anaconda3_Environments\pkgs
:
(4) Enter the following command to create an environment named PyTorch, and the Python version is 3.9:
conda create -n PyTorch python=3.9
(5) Enter the following command to delete the environment named PyTorch (note that when deleting the environment, it must be in the base environment, not in the environment to be deleted):
conda remove -n PyTorch --all
(6) View all current environments:
conda env list
conda info --envs # 另一种方式
(7) Activate the environment:
conda activate PyTorch
(8) Exit the environment:
conda deactivate
(9) Update conda:
conda update conda
(10) Update Anaconda:
conda update Anaconda
(11) If the download speed is very slow, for example, when downloading PyTorch, you can first modify the mirror source according to the following command:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
(12) View related mirror sources:
conda config --show
(13) If you need to restore the mirror source to the default settings, you can use the following command:
conda config --remove-key channels