[Virtual environment] About python virtual environment

Create a virtual environment

  1. Do not specify a path:
    The path to the virtual environment is managed separately from the main Anaconda installation directory. By default, Anaconda installs the virtual environment in the .conda\envs folder instead of the main Anaconda installation directory.
    For exampleC:\Users\username\.conda\envs\tfenv16
    conda create -n envname python=2.7
    
  2. Specify path:
    Specify the installation path of the virtual environment. You can omit the -n option and use the -p option directly. At this time, the name of the virtual environment will be automatically generated based on the specified installation path.
    conda create -p E:\anaconda3\envs\tfenv16 python=2.7
    

Activate virtual environment

activate tfenv16

Exit the virtual environment

deactivate

Delete virtual environment

Exit first, then:

conda env remove -n tfenv16

View virtual environment

conda env list

or

conda info --envs

Check the anaconda installation environment

conda info --base

Guess you like

Origin blog.csdn.net/m0_51662391/article/details/132182550
Recommended