The windows switching Python runtime environment.

1, first make sure your system has been installed in Conda, open a command line window, execute the command: conda --version

 

2. Check your system currently available Python environment, execute the command: conda info --envs, from the figure we see that the default Python environment, the environment in the name of my machine currently only created when installing Anaconda called root, correspondence the Python version 3.7

 

3, now, I want to add a Python2.7 environment, execute the command: conda create --name python27 python = 2.7, I developed a command environment name is python27, specify Python version 2.7, after executing the command, Conda will automatically download the latest version of python2.7, and automatically deploy

 

4. At this point, again, check your system currently available Python environment, execute the command: conda info --envs, from the figure we see here one more name to the Python environment python27

 

5. Check the version of Python that we are currently using, execute the command: python --version, see the current figure is from the Python environment version 3.7

 

6, switch to Python environment just newly added Python2.7, execute the command: activate python27, then execute the command: python --version, to see if the handover is successful, attentive students will find the command knock me above is performed git bash in but switching command is executed cmd, this is because I found no use in the execution git bash, do not know the other students will not.

 

7, in Python27 environment, after the completion of the work, cut back to the original Python environment, execute the command: deactivate python27 / activate two base can

 

8, if you just added Python27 environment, no longer in use, can execute the command: conda remove --name python27 --all, delete
----------------
Disclaimer: This article CSDN bloggers to the original article "Fortuna_", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/levon2018/article/details/84316088

Guess you like

Origin www.cnblogs.com/kuangrenyufeng/p/11619807.html