Use Anaconda for environment and package management

Source: Internet
Author: User

Using Conda
First, we're going to make sure you've installed the Conda.

Configuring the Environment
Next, we'll create a few environments to showcase Conda's environmental management capabilities. Make it easier for you to understand everything about the environment. We'll learn how to identify which environment you are in and how to replicate an environment as a backup.

Test python
Then we'll check which version of Python can be installed, install another version of Python, and switch between two versions of Python.

Check Package
1) We will list the packages installed on our computer

2 Browse for available packages

3 Use the Conda Install command to install and remove some packages

4 for some packages that cannot be installed with Conda, we will search on the anaconda.org website

5 for packages in other locations, we will use the PIP command to implement the installation. We will also install a 30-day free trial business Package Iopro

Remove package, environment, and Conda management Conda: Check Conda version:

Conda--version
1 1 upgrade the current version of Conda
Conda Update Conda
1 1 Managing the Environment Create and activate an environment

Use the "Conda create" command, followed by any name you wish to call it:

Conda Create--name Snowflake Biopython
1 1

This command will create a new environment for Biopython, where the Anaconda installation file/envs/snowflakes activates the new environment Linux,os X:

SOURCE Activate Snowflakes
1 1 Windows:
Activate snowflake
1 1 Small tips:

The new development environment will be installed by default in your Conda directory under the Envs file directory. You can specify a different path;
Conda create-h get more information. Small tips:

If we do not specify a version of Python to install, Conda installs the version of Python that we originally installed Conda. list all the environments

Conda Info-envis or (-e)
1 1

* Note: Conda sometimes adds a number to the front of the current active environment. * * Switch to another environment (Activate/deactivate)

To switch to another environment, type the following commands and the name of the environment you want. Linux,os X:

SOURCE Activate Snowflakes
1 1 Windows:
Activate snowflakes
1 1

If you want to switch to the system root from the path of your current working environment, type:
-Linux,os X:

SOURCE Deactivate
1 1 Windows:
Deactivate
1 1 Copy an Environment

Clones to replicate an environment. This will create a replica called Flowers by cloning snowfllakes.

Conda create-n Flowers--clone Snowflakes
1 1

Pass

Conda Info–-envs
1 1

To check the environment Delete an environment

If you do not want this environment called flowers, remove the environment as follows:

Conda remove-n Flowers 
1 2 1 2 managing Python install a different version of Python

Now we assume you need python3 to compile the program, but you don't want to overwrite your python2.7 to upgrade, you can create and activate an environment named snakes, and install the latest version of Python3 with the following command:

Conda create-n Snakes python=3
1 1 Check the Python version in the new environment

Make sure that the Python3 is running in the snakes environment:

Python--version
1 1 using different versions of Python

In order to use different versions of Python, you can switch the environment by simply activating it, and let's see how to return to the default version of Linux,os X:

SOURCE Activate-snowflakes
1 1 Windows:
Activate snowflakes
1 1 Unregister the Environment

When you have completed the studio in the snowflakes environment, log out of the environment and convert your path to the previous state: Linux,os X:

SOURCE Deactivate
1 1 Windows:
Deactivate
1 1 </

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.