Anaconda3 + How to create the environment under python3 python2 environment (win)

I have been before in anaconda3 environment has a python3 environmental installation, because now some of the demand, to install python2 environment

1. Open the anaconda anaconda prompt to view the current environment:

. 1 Conda info -e (or --envs)

2, create a file called py27 new environment, and specify the operating environment for python2.7

conda create -n py27 python = 2.7 
or the Create Conda --name py27 Python 2.7 =
 # delete 
conda remove -n py27 (that is the name of your virtual environment created) --all

 

3, created py27 context activation, the installation dependencies require activation in the current environment

# Win activation 
of an activate py27 

# win quit 
deactivate

4, python version check under the new environment as well as automatically when you create the environment conda those packages must be installed

# View python version 
python - Version 

# View installed those packages 
Conda List
 # or 
conda list -n python27

 5, the software needs to be installed into the environment under the installation package, create operating only install the necessary pkg, such as python, pip and so on, basically no other third-party libraries, if you need to install anaconda collection, you can:

# In the current environment, installation package 
conda install the package name 

# install anaconda package in the current environment collection 
conda install anaconda 

# combine command to create the environment, the above operations can be combined into 
conda create -n python27 python = 2.7 anaconda

 6, the package file import requirements.txt

# In the file directory operations 
pip install -r requirements.txt

 

Guess you like

Origin www.cnblogs.com/cl0415/p/12435119.html