Virtal environments

You install Python on your system and you start working on a website for client Nowak. You create a project folder and start coding. Along the way you also install some libraries, for example the Django framework, let say in 1.7.1 version. Now, your website is so good that you get another client Kowalski. He wants you to build another website, so you start next project and, along the way, you need to install Django again but in 1.8 version. You can't do this because this would replace the version you installed for Nowak project. There is solution: virtualenv!

To install virtualenv just:

In [ ]:
pip install virtualenv # sometimes sudo may by optional

Create a folder named 'learning.python' under your project root

In [ ]:
mkdir learning.python
cd learn.python

Create virtual environment in '.lpvenv'

In [2]:
!which python2.7 # or which python3.6
In [ ]:
virtualenv -p /usr/bin/python2.7 .lpvenv

Activate your virtual environment

In [ ]:
source .lpvenv/bin/activate

If You want deactivate just write:

In [ ]:

Copyright © 2017 Sebastian Zajac with Bootstrap and Angular.js technology