Python 3 Survival Guide

Python 3 is here, and  we are all friends. Anyway, using it needs a bit of macumba-powers. Let’s acquire this power together…

Do we love python3?... mmm we prefer 2.6 for the meantime
Python 3 adoption is still slow; some of the new feature are very well described by this presentation which is about three years old but still stand.

We show here a way to install python 3.2 without overwriting your python 2.x installation. On our system (cygwin+python) python 2.x will remain the default.

First of all, download python 3.2 as window package and install it.

After installing Python 3.2 you will need pip, the brand new replacement of easy_install.  Getting it requires distribute too, so issue:
[bash]
$ curl -O http://python-distribute.org/distribute_setup.py
$ python distribute_setup.py
$ curl -O https://github.com/pypa/pip/raw/master/contrib/get-pip.py
$ python get-pip.py
$ curl -O http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.6.tar.gz
$ tar xzvf virtualenv-1.6.tar.gz
$ cd virtualenv-1.6 && python setup.py install && cd ..
$ virtualenv –distribute c:/giorgi/python3EnvDev
[/bash]
Then do a small check:
[bash]$ which pip /cygdrive/c/Python32/Scripts/pip
[/bash]
To install a  minimal working subsystem, after activating your virtual env try:
[bash]pip install nose six cherrypy
[/bash]
Conclusions

Python 3 package list is still small compared to Python 2.x codebase. Anyway, moving to python 3 is not a pain if you know how to start. If you need complex stuff like Gevent you still must stick with 2.x snakes, but the conversion tool do a lot of good work.

 

References
http://stackoverflow.com/questions/3849762/python-3-easy-install-pip-and-pypi

Pip page

One Reply to “Python 3 Survival Guide”

Leave a Reply