1. Download the installation package from the official address
Ubuntu – Anaconda download address
2. Install the anaconda command
Install Python 3.6:
Bash ~ / Downloads/Anaconda3-5.2.0 - Linux - x86_64. ShCopy the code
Install Python 2.7:
Bash ~ / Downloads/Anaconda2-5.2.0 - Linux - x86_64. ShCopy the code
Welcome to Anaconda3 5.2.0 In order to continue the installation process, Please review the license Agreement in order to continue the installation process. Agreement.) Please, press ENTER to continue Press ENTER to view the protocol, and then press ENTER to continue.
Do you accept the license terms? [yes | no] (do you accept the license terms?)
Enter yes and press Enter to go to the next step
The next will be prompted to install address: Anaconda3 will now be installed into this location: / home/aeasringnar/Anaconda3
Press ENTER to confirm the location
Press CTRL-C to abort the installation
Or specify a different location below
The default is strongly recommended. Press Enter to proceed. Note that pressing CTRL + C will terminate the installation. Then wait for the installation. Thank you for installing Anaconda3! The installation is successful.
3. Add the conda command to environment variables
Anaconda will automatically add environment variables to PATH. If conda does not display this command, you will need source ~ /.bashrc to update environment variables. If that doesn’t work, you need to receive the added environment variable
Edit the ~ /.basrc file and add it at the end
export PATH=/home/aeasringnar/anaconda3/bin:$PATH
Copy the code
Save and exit: source ~/.bashrc
Enter conda list again to see if there is no problem.
Do you wish to proceed with the installation of Microsoft VSCode? (is it necessary to install vscode?) here you can choose yes or no and enjoy anaconda!
4. The following describes how to use some commands
At this point, type Python into the terminal. This command will start the Python interactive interface, if the Anaconda is successfully installed and can be run, will display on the right side of the Python version number “| Anaconda, Inc. |”. To exit the Python interface, type exit() or quit().
Conda’s default virtual environment directory is ~/anaconda3/envs
4.1. View the Conda version
conda --version
Copy the code
4.2 Update conda
conda update conda
Copy the code
3. Check conda help
Conda --help or conda -hCopy the code
4.4. Create a virtual environment
conda create --name env_name package_names
Copy the code
Note: env_name is the name of the created environment. You are advised to use an English name without Spaces. Package_names is the name of the package installed in the environment. If you want to install the specified version number, you simply follow the package name with the = and version number. For example, conda create –name python2 python=2.7 creates an environment named python2 in which Python version 2.7 is installed.
If you want to create multiple packages in the newly created environment, separate package_names with Spaces and add multiple package names. For example, conda create -n conda-test python=3.6 numpy pandas is used to create an environment named conda-test in which Python version 3.6 is installed and NUMpy and PANDAS are installed.
- the name
I can also replace it with minus n.
4.5. Switch the ConDA environment
conda activate env_name
Copy the code
4.6 exit the virtual environment
conda deactivate
Copy the code
4.7. Display all installed virtual environments
Conda info --envs or conda info-e or conda env listCopy the code
4.8 Replication Environment
conda create --name new_env_name --clone copied_env_name
Copy the code
Note:
Copied_env_name is the name of the environment to be copied or cloned.
New_env_name is the name of the new environment after replication.
4.9. Delete the environment
conda remove --name env_name --all
Copy the code
4.10. Package Management
4.10.1 Searching for packages accurately
Conda search --full-name Specifies the package name to search forCopy the code
4.10.2 Fuzzy Search packet
Conda Search what to look forCopy the code
4.10.3 Obtaining Information about installed Packages in the Current Environment
conda list
Copy the code
4.10.4 Specifying the Environment Installation Package
Conda install --name Environment name Name of the package to be installedCopy the code
Note: to specify the version
Conda install --name conda-test django=2.0.6Copy the code
Install Django in conda-test and set the version to 2.0.6
4.10.5 Installing packages in the Current Environment
Conda install Specifies the name of the package to be installedCopy the code
Finally, if conda does not install packages, or if packages are not available, you can use PIP to install
PIP install Specifies the name of the installation packageCopy the code