Anaconda Multi-version python management

Source: Internet
Author: User

Anaconda is an integrated Python and package management software, remember the earliest use in 2014, when there is no information online, need to use both py2 and py3, when the practice is to install ANACONDA2 and Anaconda3 at the same time, modify the files inside, For example, the exe file of the Conda command, renamed to Conda3, this practice can be used but there are many problems, these days need to use the following Spyder (integrated IDE in Anaconda) Discovery Console has been shown connecting to kernel, I used the WIN10 system, which may be I changed the environment, resulting in a failure to function properly. Re-installed the system, because later Py3 will become more and more popular, it is intended to install Python2 and Python3, the following is my trip to the pit.

Anaconda installation is not here to repeat, remember in the installation when the check box to modify the environment variable, first introduce the following directory X:\Anaconda2\envs, as the name implies this is the Python environment directory.

In the console (CMD) input

Conda Info--envs

Displays the currently existing Python environment, with the representation of the * number being the currently active environment. You can see that the name of the environment is named after the folder under the Envs directory, such as Snake (just named)

Method 1 (I did not succeed)

There is a multi-version of the online method is to install a different version of the Anaconda in the X:\Anaconda2\envs directory, such as Anaconda3, installation folder name casually, I use snake here. Use instructions when switching to Python version

Activate snake

Note that the front of the console (snake) marks the entry into the environment named Snake.

To return to the original environment, use

Deactivate snake

Online said, but using Conda to manage different versions of the package, in different environments, the console input Spyder command to enter the corresponding Python version of the IDE environment, I tried a bit failed. I think this method is not correct, because in the Envs directory to install other versions of Anaconda, each version has its own conda and other instructions, and the environment of the Anaconda version also has its own ENVS environment, so will not be trapped in the loop? Another approach is described below

Method 2

Create an environment named Snake, specifying a version of 3.6

Conda Create--name Snake python=3.6

This will automatically create the folder snake in the Envs directory and download the Python version 3.6. Multiple environments share the same set of Conda directives, and the environment can be switched through directives Activat and deactivate. Enter the snake environment you can use the Conda list directive to display the packages that are installed in the current environment. If you want to delete an environment directive as

Conda Remove--name Snake--all

Anaconda Multi-version python management

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.