The python installations on the Shared Computing Cluster (SCC) include many common python libraries and packages. Most of these are general purpose libraries made available from the Python Package Index (PyPI). Instructions for checking package installation and versions are detailed on this page. If you need a package that is not installed in our python modules, please see our Installing Python Packages page or request installation page.

Strategies to check existing packages and versions are:

 

List “pip” Installed Packages from PyPI

Centrally Installed Python Packages

The “pip” command with the “list” method will print a list of all centrally and locally installed PyPI packages and their versions. Because most of our packages are installed this way, this is the fastest way to list package information.

scc1$ module load python/2.7.13
scc1$ pip list
alabaster (0.7.9)
appdirs (1.4.0)
argcomplete (1.8.2)
ase (3.13.0)
astroid (1.4.9)
...

 

User Installed Python Packages

To print a list of user-installed packages in your user directory (~/.local), add the “--user” option and it will limit the scope of the output. Python will search the user directory before the central install location, so it is important to keep user installed packages up to date or remove them in preference to the globally installed versions.

scc1$  module load python/2.7.13
scc1$ pip list --user
bluepyopt (1.5.5)
deap (1.0.2)
efel (2.11.14)
HTSeq (0.7.2)
ipyparallel (6.0.2)
...

 

List All Installed Packages/Module

Not all packages were installed from the Python Package Index (PyPI) and these packages should be queried differently. The python interpreter’s built in “help” function can list and provide details for any installed package/module. This command will attempt to load all installed modules and can sometimes produce errors for modules that have deprecated functions or require prerequisite software before loading. This is method is the most general way to list packages, but can be very slow.

scc1$  module load python/2.7.13
scc1$ python
Python 2.7.13 (default, Feb  8 2017, 12:51:33) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> help('modules')
 
Please wait a moment while I gather a list of all available modules...
 
# This command will attempt to load all modules and produces errors
# for modules that have deprecated functions or require prerequisite
# software before loading. This is normal.
 
BaseHTTPServer      cellh5              leveldb             runipy 
Bastion             cellprofiler        lib2to3             runpy 
Bio                 centrosome          libfuturize         scandir 
BioSQL              certifi             libpasteurize       sched 
CDROM               cgi                 libtiff             schema 
... 
 
Enter any module name to get more help.  Or, type "modules spam" to search 
for modules whose descriptions contain the word "spam". 
 
In:  

 

Individual Package Version

Sometimes faster than rooting through the full list of installed packages is simply loading the package and checking the version directly. Most, but not all, packages have an attribute “__version__” (note, these are double-underscores on both sides of the word “version”) which contains the version number for that package/module.

scc1$ module load python/2.7.13
scc1$ python
Python 2.7.13 (default, Feb  8 2017, 12:51:33) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import spyder
>>> spyder.__version__
'3.1.3'
>>>