Python3 Virtual Environment setup under Windows

Source: Internet
Author: User
Tags virtual environment virtualenv

To avoid installing too many Python toolkits causing the Python directory to be bloated and even incompatible between packages, it is necessary to install the virtual Python environment--virtualenv for Python. With virtualenv installed, you can create any number of small virtual Python environments based on tasks, install specific packages for specific projects, and delete the corresponding virtual environments directly after the experiment.

Virtualenv can download the installation by visiting the following link: http://pypi.python.org/pypi/virtualenv.

Open cmd under Windows platform and go to the VIRTUALENV installation package to extract the directory.

$ python Install setup.py

Once the installation is complete, you can use Virtualenv to create a new environment. Virtualenv-h View help information. Create and activate the virtual environment.

$ virtualenv geo_env$ CD geo_env\scripts$ start activate

Install the required packages in a virtual environment

$ pip Install Pygeocoder

Run your own project in a virtual environment

From pygeocoder import geocoderif __name__ = = ' __main__ ': address = ' 207 N. Defiance St, Archbold, OH ' Print (geocoder.ge Ocode (address) [0].coordinates]

Run the above code to get the latitude and longitude of the address:

$ python search.py (41.521954,-84.306691)

End of experiment, close virtual environment

$ deactivate

If you do not need the environment, you can delete the directory for that virtual environment. If you need to create a new environment based on a virtual environment, you can

$ virtualenv--download-p Geo_env\scripts\python.exe geo_env_new

The new geo_env_new environment has a geo_env of existing packages.



If the Pycharm ide,pycharm is installed, the virtualenv is integrated and the new project enters

File-->settings-->project-->project Interpreter

Select an existing environment, or add local, or create virtualenv.


Learn "Python network programming (third edition)" (Brandon Rhodes) with a little memory.

This article is from the "Small Network programming Novice" blog, please be sure to keep this source http://ustchch.blog.51cto.com/12924303/1934769

Python3 Virtual Environment setup under Windows

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.