Ubuntu Aptget Python stuff

Posted under » Ubuntu » Python on 08 December 2009

To list the version of Python you are having

python -V
python3 -V

To install an old version

apt-get install python2.4

To install new version

apt-get install python3.7

python2.5 and python3.7 will happily coexist. Python2.5 puts its libraries in /usr/bin/python2.5 while python3.7 puts them in /usr/bin/python3.7 and so forth.

Now add Python 3.6 & Python 3.7 to update-alternatives.

update-alternatives --config python3

By default, Python 3.6 is pointed to Python 3. That means when we run python3 it will execute as python3.6 but we want to execute this as python3.7.

Select the selection number for Python 3.7

Now, type python3 -V to see which version of python 3 you are using.

Installing modules

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

python setup.py install

python egg
In some cases, you can install 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)
apt-get install python-requests 
apt-get install python3-pip

You can do interesting scrubbing stuff with requests. You can also try BeautifulSoup.

Latest Versions

If you install stuff, location is.

To uninstall

apt-get remove --purge python-mako

To renstall

apt-get --reinstall install python-mako

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

web security linux ubuntu GIT svn Raspberry apache mysql php drupal cake symfony javascript Ajax css