Danish J
1 min readJan 27, 2017

--

Getting Started with virtualenv for Python

virtualenv creates an isolated environment for your project allowing you to install different versions of libraries as well as python for your project without creating conflicts between your projects/libraries your OS might be using.

As an example, you are working on a project where you want to take advantage of python 3.x. Your default python on the OS is python 2.x

Assuming you already have virtualenv and python3 installed you can create virtual environment in 2 ways.

One of the ways is

# env is name of your environment$ python3 -m venv env
$ source ./env/bin/activate

OR another way of creating one is this

$ virtualenv -p python3 env
$ source ./env/bin/activate

Choice is yours.

By doing either of the above, virtualenv will create a directory structure that has pip, python, activate scripts available for you to use within your project

activate activate.fish easy_install pip pip3.6 python-config python3.6
activate.csh activate_this.py easy_install-3.6 pip3 python python3 wheel

Enjoy!

--

--

Danish J

Software Developer, trying to share some brain dump in no particular order 😀