Anaconda series 1: Ubuntu install Anaconda 3 (detailed installation steps and common commands
1. Download Anaconda 3
Domestic users can obtain Anaconda from the Tsinghua University open source software mirror station . 3.
Sort by date, download the latest version, and choose Linux 64-bit version to download.
Here I choose to download: Anaconda3-2020.11-Linux-x86_64.sh
2. Install Anaconda 3
2.1 Execute bash installation
2.1.1 Go to the downloaded folder, right click to execute the command and open the terminal
2.1.2 Input in the terminal
bash Anaconda3-2020.11-Linux-x86_64.sh
2.1.3 Input
yes
2.1.4 Keep Entering
After entering
yes
2.1.5 Press Enter to select the default installation directory
2.1.6 Initialize anaconda
2.1.7 Installation is complete
2.2 Prompt "conda: command not found" solution
Append the path of anaconda to the end of the /.bashrc file (/home/yourname/anaconda3/)
echo 'export PATH="/home/hans/anaconda3/bin:$PATH"' >> ~/.bashrc
Update source
source ~/.bashrc
Re-execute the following command and the version number can be printed normally, which means the installation is successful.
View conda version: conda -V
View python version: python -V
3. Anaconda 3 common commands
Serial number | Features | command | Remarks |
---|---|---|---|
1 | View conda version | conda --version,conda -V |
|
2 | Update conda | conda update conda |
|
3 | View conda help (a useful command for beginners) | conda --help,conda -h |
|
4 | New virtual environment | conda create --name <env_name> <package_names> |
Multiple package names are separated by spaces |
5 | Switch conda environment | conda activate env_name |
|
6 | Exit the virtual environment | conda deactivate |
|
7 | List all virtual environments | conda info --envs conda info -e conda env list |
|
8 | Copy environment | conda create --name new_env_name --clone copied_env_name |
|
9 | Delete environment | conda remove --name env_name --all |
|
10 | Find packages precisely | conda search --full-name <package_name> |
|
11 | Fuzzy search package | conda search <something for search> |
|
12 | Get information about packages installed in the current environment | conda list |
|
13 | Specify the environment installation package | conda install --name <env_name> <package_names>指定版本:conda install --name <env_name> <package_name=version> |
|
14 | Install the package in the current environment | conda install <package_names> |
|
15 | pip install | pip install <package_names> |
Conda can not be installed (or not) can be installed with pip |
4. Add/replace conda Tsinghua source
conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/' #必需
conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/' #必需
conda config --set show_channel_urls yes