{ForMyFutureQuickReference}-How to setup a Python Virtual Environment

Posts with {ForMyFutureQuickReference} tag are, as the name suggests, for my future quick reference. These posts could also help others, it’s a plus if it does.

Instead of depending on the machine level global python installation and packages, you can have a project/application specific set of  python interpreter & packages. The benefit is, you get an isolated python development environment for each of your development projects. You do this by creating a Python Virtual Environment.

The following command will create a Python Virtual Environment.

python -m venv env1

env1 is the Virtual Environment name.

A folder gets created as env1 and it will contain the python interpreter and default libraries. You need to activate the virtual environment by:


Now you will get a prompt as below:

Notice the “(env1)”, now whatever python packages you install will go into this virtual environment, until you issue the “deactivate” command to come out of the Virtual Environment.

Leave a Reply

Your email address will not be published. Required fields are marked *

Copy link
Powered by Social Snap