Logo

Ubuntu Aptget Python stuff

Posted under » Ubuntu » Python on 08 December 2009

To list the version of Python you are having

python -V

To install an old version

apt-get install python2.4

python2.4 and python2.5 will happily coexist. Python2.5 puts its libraries in /usr/lib/python2.5 while python2.4 puts them in /usr/lib/python2.4 and so forth. /usr/bin/python will typically be a symlink to the latest version of python (/usr/bin/python2.5), and you can specifically use version 2.4 by running /usr/bin/python2.4.

Installing modules

The manual mode. Sometimes, the command look like this.

python setup.py install

python egg
In some cases, you can instal stuff by the python egg. Which is basically a shell script ie you have to chmod it to 755 prior to execution.

In Ubuntu if you want the latest version you may install it by Apt-get

apt-get install python-cherrypy3
apt-get install python-mako (will install sqlalchemy as well)
apt-get install python-biopython
apt-get install python-setuptools (for easy_install)

Latest Versions

If you install stuff, location is.

To uninstall

apt-get remove --purge python-mako

To renstall

apt-get --reinstall install python-mako

python2.4 and python2.5 will happily coexist. Python2.5 puts its libraries in /usr/lib/python2.5 while python2.4 puts them in /usr/lib/python2.4 and so forth. /usr/bin/python will typically be a symlink to the latest version of python (/usr/bin/python2.5), and you can specifically use version 2.4 by running /usr/bin/python2.4.

Sometimes you can't uninstall a module while you are on a different version of Python at the time of uninstall while corrupting the module in the process. When this happens, you need to