#Building a Python environment1. Download python3.5 and python2.7, installation;2change the Python.exe in python3.5 to Python3.exe;3add two versions of Python's path to environment variables, respectively; such as: C:\Python\python27 and C:\Python\python27\Scripts4. Set PIP3 and PIP2 to execute two commands for two versions: Python3-m pip install--upgrade pip--force-Reinstall Python2-m pip install--upgrade pip--force-Reinstall#to do a re-installation of Pip, you can view the version through Pip2-v,pip3-v; #Delete the pip file under the Script folder in python3.5 to avoid conflict with python2.7;#Building a virtual environment1. Mode one, directly using virtualenv pip install virtualenv#The virtualenv startup file will be generated under the script folder of python2.7; #The creation of a virtual environment requires that the virtualenv be executed in this directory some_env #execute Aictivate.bat under the Scripts folder in the created Some_env file, activate and enter the environment; #in this directory Deactivate.bat exit the current virtual environment;2. Mode two, through virtualenvwrapper-win with virtualenv use, simplify operation; PIP3 Install virtualenv pip3 install Virtualenvwrapper-win#simplifies the way one operation, mkvirtualenv some_env Create and activate the virtual environment; #Deactivate exit the current virtual environment directly, rmvirtualenv delete the virtual environment;
# use PIP installation package in virtual environment instead of PIP3;#Note: Do not have this misoperation, perform pip install virtaulenv operation in the directory of the virtual environment,#because there is also a PIP in the virtual environment, it will be installed in the virtual environment;
# Virtual Environment is located on the path: C:\Users\Administrator\Envs\mic_django_py2
Windows Python environment, and virtual Environment building | Python