Python¶
Newer versions of python are maintained as part of the software modules. The python version as well as all of the python packages are normally updated on a quaterly basis. We will add modules when requested to the latest python module. We typically do not update or modify older versions of the python module since that may affect users that rely on a different combination of packages.
The currently available python modules:
module avail python
------------------------------------ /software/modulefiles ---------------------
python/2.7 python/2.7-2014q2 python/2.7-2015q2(default)
python/2.7-2013q4 python/2.7-2014q3 python/3.3
python/2.7-2014q1 python/2.7-2015q1 python/3.4-2015q1
-------------------------------------- /etc/modulefiles ------------------------
The python/2.7 and python/3.3 were created before we started versioning the module by date. Those modules should not be used by new users.
This command will give the full list of packages and versions in a specific python module:
pip list
Installing Packages¶
Typically python packages have the option –user to be installed in your local directory. We recommend using pip to install packages, For example this command will install the latest seaborn package to your home directory:
pip install --user seaborn
Plotting with matplotlib¶
For interactive plotting, it is necessary to set the matplotlib backend to a graphical backend. Here is an example:
#!/usr/bin/env python
import matplotlib
matplotlib.use('Qt4Agg')
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show()
If you are saving files and viewing them with the display command, you may experience rapid flickering. There seems to be an issue with image transparency, use a command like this to disable the transparency:
display -alpha off <image>