Anaconda installation - super detailed version (2023)

Foreword:

When learning machine learning, Anaconda is generally used.

Anaconda is a powerful open source data science platform, which integrates many good tools, greatly simplifies the user's workflow, and can help users solve a series of data science problems.

Some friends are struggling to install python or install anaconda first. The suggestion here is to install anaconda, so there is no need to install python separately, because anaconda comes with python, and after installing anaconda, the default python version is the python version that comes with anaconda.

The installation of Anaconda is divided into two situations:

Situation 1 : The computer is not installed with python or it can be uninstalled now ( uninstall python first when installing Anaconda )

Situation 2: The computer is currently installed with python, but I want to keep it (It is more complicated, please refer to other tutorials on the Internet!)

Completely uninstall python

First, use the uninstall tool that comes with the computer housekeeper to uninstall python , and manually delete the files in the installation directory (this part is very simple and will not be introduced in detail), and then delete the environment variables:

Step 1 : Computer (right click) → Properties → Advanced System Settings → (click) Environment Variables

insert image description here

Step 2 : View the environment variables set by the user, which is the column above, find the path, double-click the value behind the path, and enter to view the environment variables you have set.

insert image description here

Step 3 : Delete all the variables for installing python, select both values ​​in the figure, then click delete, and then confirm ( if the environment variables are automatically deleted after uninstalling python, don’t worry about it! )

insert image description here

Note : When exiting, don't forget that there are several confirmation buttons outside, which also need to be clicked, do not cross them directly, otherwise the settings will not be saved.
insert image description here
ok, at this point, python is completely uninstalled!

Anaconda download address

  • Note: During the Anaconda installation process, the more error-prone link is the configuration of environment variables, so everyone should be more careful when configuring environment variables.

Method 1: Log in to the Anaconda official website .
insert image description here

  • This is how it goes in, just click "Download". (Must be Windows environment and 64-bit

Method 2: The official website download is too slow, the recommended download address: ** Click here to download from Tsinghua Mirror Station

insert image description here

Installation detailed steps

  1. Double-click the downloaded installation package

insert image description here

  1. Click Next

insert image description here

  1. Click I Agree

insert image description here

  1. Select All Users

insert image description here

  1. Choose the installation path , here you must choose a disk other than the C disk! !

insert image description here

  1. Only select the second item , the second item is to use the python version by default, and manually add environment variables later ,

insert image description here

  1. Click Install, and the installation will take a while.

insert image description here

  1. Click Next:

insert image description here

  1. For the two "learn", untick both, so you don't need to open it to see it, and waste time.

insert image description here

  1. Then wait for it to be installed. After installation, we need to manually configure the environment variables.

Configure environment variables

Computer (right click)→Properties→Advanced System Settings→(click)Environment Variables In the system variables
insert image description here
below , find and click Path In the edit environment variables, click New to enter the following five environment variables. (It's not exactly the same here! You need to change "D:\WorkSoftware\Install\Anaconda3" involved in the following five environment variables to your Anaconda installation path)
insert image description here

insert image description here

D:\WorkSoftware\Install\Anaconda3
D:\WorkSoftware\Install\Anaconda3\Scripts
D:\WorkSoftware\Install\Anaconda3\Library\bin
D:\WorkSoftware\Install\Anaconda3\Library\mingw-w64\bin
D:\WorkSoftware\Install\Anaconda3\Library\usr\bin

Briefly explain the purpose of the five paths : Among the five environment variables, 1 is required by Python, 2 is the script that comes with conda, 3 is the dynamic library of jupyter notebook, and 4 is when using C with python

insert image description here
After the creation is complete, click OK !

Verify that the installation was successful

Press win + r at the same time, enter cmd, and check the anaconda version on the pop-up command line, enter:

conda --version

insert image description here
enter:

python

insert image description here
If the version number appears, it means the configuration is successful!

On the Windows logo key in the lower left corner of the computer screen, select and click the green circle Anaconda Navifator to open it.
insert image description here
When this interface appears, the installation is successful:
insert image description here

At this point, the basic installation and settings are just fine!

Change conda sources (subsequent installation of third-party libraries can speed things up)

use

conda install 包名

It is very convenient to install the required Python package, but the official server is abroad, and the download speed is slow. Tsinghua University in China provides a mirror warehouse of Anaconda. We change the source toMirror source of Tsinghua University

Operate in the Anaconda prompt:

insert image description here

Enter the following command on the command line to

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/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
 
//设置搜索时显示通道地址
conda config --set show_channel_urls yes

insert image description here

Check if the channel is modified:

conda config --show channels

insert image description here

restore default sources

conda config --remove-key channels

Delete the old mirror source

conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/cpu/

Add a new mirror source

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/cpu/

Super detailed and complete uninstall Anaconda tutorial

Completely uninstall the Anaconda tutorial, reproduced!

Tensorflow-gpu installation

If you want to do deep learning, you may need to install tensorflow, pytorch, etc. If you need to install tensorflow-gpu, you can refer to my other blog:

Tensorflow-gpu nanny level installation tutorial

Guess you like

Origin blog.csdn.net/weixin_43412762/article/details/129599741