Anaconda download, installation, uninstallation and environment configuration

1. Download Anaconda

Enter the Anaconda official website and download the Linux version of anaconda (file ending in .sh)
https://www.anaconda.com/download
Insert image description here

2. Install Anaconda

1. Copy the file to Ubuntu and enter the command in the corresponding location sh 文件名.shto install (it is recommended to install under the root user)
Insert image description here

2. Keep pressing the ENTER key until the page for selecting yes and no appears, and enter yes on the keyboard.
Insert image description here

3. Select the installation location and enter the location you want to install (note: when installing anaconda here, it is best to install it in a directory that ordinary users can access, such as /usr/local, /opt, /home, otherwise ordinary users may not be able to use it normally )
Insert image description here

If you only need to use anaconda under the root account, just press the ENTER key to select the default location. I installed it here under the default path /root/anaconda3
Insert image description here

4. Initialize the conda environment: Enter yes on the keyboard to automatically configure the environment; enter no on the keyboard to customize the configuration environment later.
Insert image description here

3.Anaconda’s environment configuration

1. Find the installation location of Anaconda. There will be a prompt for the default installation. It is usually home/username/anaconda3. I installed it under /root/anaconda3 this time. 2. Enter and edit the environment
Insert image description here
variables vi ~/.bashrcand add the following content:

export PATH="/自己对应的路径名/anaconda3/bin:$PATH"

Write your own corresponding path name here. Mine is export PATH="/root/anaconda3/bin:$PATH"
Insert image description here

3. Activate the modified content: source ~/.bashrc
4. Test whether the configuration is successful: enter conda, if not fond is not displayed, it means anaconda is installed and configured successfully.
Insert image description here

4.Give ordinary users/super users permission to use Anaconda

Whether you install it under the root user or an ordinary user, when installing anaconda, it is best to install it in a directory that ordinary users can access, such as /usr/local, /opt, /home, otherwise ordinary users will not be able to use anaconda.
(1) Anaconda is installed under the root user, and you want to give ordinary users the permission to use anaconda.
For example, the installation location is /opt/anaconda3, execute directly under the ordinary user: /opt/anaconda3/bin/conda init bash, and then execute conda env listthe test
Insert image description here
(2) Anaconda installed under the ordinary user , you want to give the super user (root) permission to use anaconda.
For example, the installation location is /home/xxx/anaconda3, run directly under the root user: /home/xxx/anaconda3/bin/conda init bash, and then execute conda env listthe test
Insert image description here

5. Uninstall Anaconda

If you accidentally install anaconda in a directory that is inaccessible to ordinary users, such as /root or /home/root, you can uninstall anaconda and reinstall it.
(1) Delete the installation directory: rm -rf /root/anaconda3
(2) Edit the environment variable file vi ~/.bashrcand comment or delete the path of anaconda3
(3) Make the modified environment variables take effect immediately:source ~/.bashrc

Guess you like

Origin blog.csdn.net/weixin_44330367/article/details/132077898