https://blog.csdn.net/u012005313/article/details/82347817
main content:
- View a list of environment
- Create a new
Python
environment - Activate / deactivate
Python
environment - Cloning / remove 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 createPython
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
Python
environment
reference:
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