Skip to content

Instantly share code, notes, and snippets.

Star You must be signed in to star a gist
What would you like to do?
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 

Now create a virtual environment

virtualenv venv 

you can use any name insted of venv

You can also use a Python interpreter of your choice

virtualenv -p /usr/bin/python2.7 venv

Active your virtual environment:

source venv/bin/activate

Using fish shell:

source venv/bin/

To deactivate:


Create virtualenv using Python3

virtualenv -p python3 myenv

Instead of using virtualenv you can use this command in Python3

python3 -m venv myenv
Copy link


Copy link

Thanks. it worked for me in zorin os

Copy link

@mursalatul could you please name dele to venv your command should look like this source venv/bin/activate you can create venv using this command python3 -m venv venv

thank you. i appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment