:Anaconda3(0)

https://blog.csdn.net/u012005313/article/details/82347817

 

main content:

  1. View a list of environment
  2. Create a new  Python environment
  3. Activate / deactivate  Python environment
  4. Cloning / remove environment

View a list of environment

Check  Python the operating environment can be achieved by following commands

conda env list

 

 

 

 Note: In the environment of the displayed list, with an asterisk highlight the current environment

Creating a new Python environment
Reference:

Installing a different version of Python

Creating an environment with commands

For example, I have a Python3.6 environmental installation, you want to install Python2.7 environment

conda create -n py27 python=2.7

  

  • Parameter  py27 refers to the name of the newly created environment
  • python=2.7 Refers you want to create  Python versions

Execution log is as follows:

 

 

 

 

Similarly, if you want to create  Python3.6 the environment, the command is as follows:

conda create -n py36 python=3.6
Activate / deactivate  Python environment

reference:

Activating an environment

Deactivating an environment

After installation is complete, listing  Python the environment list

@ Virtual-zhujian-zhujian Machine: ~ $ Conda info --envs 
# Conda Environments: 
# 
Base * / Home / zhujian / Software / Anaconda / anaconda3 
py27 / Home / zhujian / Software / Anaconda / anaconda3 / Envs / py27

  Switch to the new environment created py27

conda activate work_py27

 

 

 

 Switch back to basic environment

conda deactivate

 

 

 

Display the name of the environment

 

参考:determining-your-current-environment

By default, after switching to the new environment, the name is displayed at the command prompt, you may be removed by the following command:

conda config --set changeps1 false

  ON command:

conda config --set changeps1 true

  

Guess you like

Origin www.cnblogs.com/kekeoutlook/p/11723165.html