Python

From UFRC
Jump to navigation Jump to search

Description

python website  

Python is a programming language that lets you work more quickly and integrate your systems more effectively. You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs. Python version 3 is the current implementation of Python while python2 is a legacy version no longer supported after 2020-01-01.

Python vs Python-Core

The python environment module provides a full-featured python installation with around 300 installed python modules for development and use of python applications for research. If you only need the core python build to provide a scripting interface for the application you are building see the python-core environment module.

Environment Modules

Run module spider python to find out what environment modules are available for this application.

System Variables

  • HPC_PYTHON_DIR - installation directory
  • HPC_PYTHON_BIN - executable directory
  • HPC_PYTHON_LIB - library directory

and modifies PYTHONPATH and PYTHONHOME, so you could use them in your scripts.

Additional Information

  • After the appropriate environment module is loaded - type "python" at the command line to open an interactive session.
  • To run a python script type python scriptname.py. If the correct "shebang" line is used at the top of the script E.g.
#!/usr/bin/env python

then the script can be run directly as scriptname.py if it's in the executable path or as ./scriptname.py if it's in the current directory. The same rules apply to using a python script in a batch job script.

You can request installation of additional modules by submitting a request ticket in the Support System. The support request tickets can be used for requesting software installation, finding a solution to a particular problem, or just asking a question.

Matplotlib backend

If you are trying to use matplotlib and get an error similar to

import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter

then you should try the following:

import matplotlib
matplotlib.use('Agg')

before importing pyplot from matplotlib.


Output Buffering

If your job starts, but doesn't appear to produce output from 'print' statements in the job log for a long time, but you want to see that output immediately then turn off output buffering. You can either add a flush=True argument to the print calls you are interested in or run the script with

srun --unbuffered python SCRIPT.py

Available modules

To see all installed modules names load the environment module and run pip3 list or python -c "help('modules')" command before submitting a request for a new module installation. Below is a list of modules and versions installed in the default python version. Automatically generated list of python modules installed with the Python Package Manager (pip) under the default python version.

Name Version
alignlib-lite 0.2.3
alignment 1.0.9
apptools 4.2.1
argcomplete 0.8.1
argh 0.25.0
argparse 1.2.1
arrow 0.5.4
arvados-python-client 0.1.20150401195008
astroid 1.3.8
autopep8 1.2
awscli 1.7.18
backports.ssl-match-hostname 3.4.0.2
basemap 1.0.7
bcbio-gff 0.4
bcdoc 0.13.0
bioblend 0.6.1.dev0
biom-format 2.1.4
biopython 1.65
blockcanvas 4.0.3
boto 2.38.0
botocore 0.99.0
bugsy 0.6.0
bugzilla 1.0.0
bx-python 0.7.1
certifi 2015.04.28
chaco 4.4.1
chanjo 2.3.2
click 4.1
CNVkit 0.3.5
cobra 0.3.2
codetools 4.2.0
colorama 0.3.3
configobj 5.0.5
Connectome-Viewer 2.0.0
cutadapt 1.4.2
cvxopt 1.1.7
Cython 0.22
cyvcf 0.1.13
DateTime 4.0.1
decorator 3.4.0
DendroPy 4.0.3
diptest 0.0.0
docopt 0.4.0
docutils 0.11
ecdsa 0.11
enable 4.4.1
encore 0.5.1
envisage 4.4.0
eta 0.9.7
ets 4.4.2
etsdevtools 4.0.2
etsproxy 0.1.2
Fabric 1.10.1
fisher 0.1.4
flake8 2.4.1
fluff 0.1.1
future 0.14.1
futures 2.2.0
Gato 1.2.2
GDAL 1.11.1
gdata 2.0.18
getent 0.2
gffutils 0.8.2
glob2 0.4.1
graphcanvas 4.0.2
graphviz 0.3.3
h5py 2.3.1
html5lib 0.999
HTSeq 0.6.1p1
httplib2 0.9
illumiprocessor 2.0.6
ipdb 0.8
ipython 3.1.0
ipython-cluster-helper 0.4.3
isodate 0.5.0
jdcal 1.0
Jinja2 2.7.3
jmespath 0.6.1
joblib 0.7.1
jsonschema 2.4.0
Lagrange 20130526
Lasagne 0.1.dev0
leveldb 0.193
Logbook 0.9.0
logging 0.4.9.6
logilab-common 1.0.2
lxml 3.4.0
mahotas 1.2.4
mandrill 1.0.57
MarkupSafe 0.23
matplotlib 1.3.1
matplotlib-venn 0.11
mccabe 0.3.1
msgpack-python 0.4.6
MySQL-python 1.2.5
netCDF4 1.1.7.1
netifaces 0.10.4
networkx 1.9.1
nibabel 1.3.0
nipy 0.3.0
nipype 0.9.2
nitime 0.5
nose 1.3.7
numexpr 2.4
numpy 1.9.0
oauth2client 1.4.7
obspy 0.10.2
Oncotator 1.5.2.0
OpenMM 6.2.0
openopt 0.5404
openpyxl 1.8.6
oursql 0.9.3.1
pandas 0.16.0
paramiko 1.13.0
path.py 7.2
patsy 0.3.0
pbh5tools 0.8.0
pep8 1.6.2
phonopy 1.9.2-rc5
phyluce 2.0.0
PIL 1.1.7
Pillow 2.4.0
planemo 0.13.2
poster 0.8.1
prettytable 0.7.2
profiling 0.0.0.dev0
progressbar 2.2
protobuf 2.5.0
psutil 2.1.3
ptyprocess 0.4
py 1.4.23
pyasn1 0.1.7
pyasn1-modules 0.0.5
pybedtools 0.6.9
pycrypto 2.6.1
pydot 1.0.2
pyface 4.4.0
pyfasta 0.5.2
pyflakes 0.9.2
PyGithub 1.25.2
Pygments 1.6
pylint 1.4.4
pylint-runner 0.3
pymc 2.3.4
pymongo 2.7
pyparsing 2.0.2
pyproj 1.9.4
pyqi 0.3.2
pysam 0.8.4
pysamstats 0.23
pytest 2.6.1
python-ase 3.8.1.3440
python-dateutil 2.2
python-gflags 2.0
python-libsbml-experimental 5.11.4
pythonpy 0.4.0
pytz 2014.4
PyVCF 0.6.7
PyWavelets 0.2.2
PyYAML 3.11
pyzmq 14.4.1
qiime-default-reference 0.1.1
rdflib 4.1.2
redis 2.10.1
reportlab 3.1.44
requests 2.7.0
requests-toolbelt 0.4.0
rpy2 2.7.4
rsa 3.1.4
scikit-image 0.10.1
scikit-learn 0.15.2
scikits.statsmodels 0.3.1
scimath 4.1.2
scipy 0.14.0
ScreamingBackpack 0.2.333
screed 0.7.1
seaborn 0.5.1
seqtools 0.8
setproctitle 1.1.8
sh 1.11
Shapely 1.5.7
simplejson 3.6.3
singledispatch 3.4.0.3
six 1.10.0
spanki 0.4.3
SPARQLWrapper 1.6.4
Sphinx 1.2.2
SQLAlchemy 1.0.8
sympy 0.7.5
tables 3.1.1
tabulate 0.7.5
terminado 0.5
Theano 0.6.0
toml 0.9.0
toolz 0.7.1
tornado 3.2.2
traits 4.5.0
traitsui 4.4.0
TravisPy 0.3.3
uritemplate 0.6
urllib3 1.10.2
urwid 1.3.0
virtualenv 1.11.2
wget 2.0
ws4py 0.3.4
wsgiref 0.1.2
XlsxWriter 0.7.3
xlwt 0.7.5
xray 0.6.1
zope.interface 4.1.1