Setup a virtualenv for Python3

Just a quick note on using Python 3 in virtualenvs without changing the system python version. Most of this is shamelessly and gratefully copied from here.

1. Check system python version

$ python -V 
Python 2.7.3

2.  Install python 3

$ apt-get install python3 python3-doc

3. Setup a new virtualenv with python3

$ mkvirtualenv --python=/usr/bin/python3 python3

4. Check virtualenv python version

$ python -V
Python 3.2.3
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s