Windows Python environment, and virtual Environment building | Python

Source: Internet
Author: User
Tags virtual environment virtualenv

#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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.