Python versions on Hippu

Python versions 2 and 3 differ somewhat so that the former is started usually with python and the latter with python3. If you want to use Unicode characters, you should use Python version 3.

The default Python interpreter one gets on Hippu4 is Python 2.6.6 and on Hippu1 it is Python 2.4.1 (on 2012-03-14). 2.4.1 is a fairly old version. In order to get an up to date version, one can use module, see LinuxToolsModule to see how you can check which versions of Python are available. In order to load the version 3.2.2 (see www.python.org for more details):

hippu1:~
$ module load python/3.1.1-gcc
hippu1:~
$ python -V
Python 3.1.1

The Python 3 is not fully compatible with the version 2 due to the Unicode character set and some changes in the syntax, in particular the print function. Both versions can be available at the same time once they are loaded. Start the version 2 by python and the version 3 by python3.

One may access a more recent version of Python 2 (e.g. on Hippu 1) you should first chack what versions are available (module avail -l 2>&1 | egrep python). Then you should probably unload the currently loaded version and then load the more recent one:

hippu1:~
$ module unload python/2.4.3-gcc
hippu1:~
$ module load python/2.6.5-gcc
hippu1:~
$ python -V
Python 2.6.5

The unloading of the previous Python version before loading the replacement is usually needed only if you have already loaded another version of the same tool. The Module system loads and unloads software by setting the environment variables and cannto do loadings and unloading in any order.

-- KimmoKoskenniemi - 2010-02-22

Topic revision: r3 - 2012-03-14 - KimmoKoskenniemi
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback