Monday, August 2, 2010

Using easy_install with an explicit version of Python

It is possible to have multiple versions of Pyton installed on your system:

$ ls -1 /usr/bin/py*
/usr/bin/pydoc
/usr/bin/pydoc2.5
/usr/bin/pydoc2.6
/usr/bin/python
/usr/bin/python-config
/usr/bin/python2.5
/usr/bin/python2.5-config
/usr/bin/python2.6
/usr/bin/python2.6-config
/usr/bin/pythonw
/usr/bin/pythonw2.5
/usr/bin/pythonw2.6

This can be a problem when you use easy_install to install a new Python package:

easy_install -U Sphinx

Fortunately, you will find multiple versions of easy_install on your machine:

$ ls -1 /usr/bin/easy_install*
/usr/bin/easy_install
/usr/bin/easy_install-2.5
/usr/bin/easy_install-2.6

This makes it possible to use easy_install with an explicit version of Python:

$ easy_install-2.6 -U Sphinx

No comments: