What is Python?
Python is a widely used high-level general purpose, interpreted, extensible programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming with dynamic typing and dynamic binding. It supports modules and packages, which encourages program modularity and code reuse. Python is ideal for writing higher-level parts of large-scale scientific applications and driving simulations in parallel architecture like clusters of PC’s or SMP’s.
To use non-default Python version, please use the following commands or refer to the sample PBS/SLURM scripts at
|HPC2015||module load python/[version]|
If you invoke python without loading it via module/script first, you will get the default system python.
* Python 2.7 has been end of support since January 2020. We suggest user porting your codes to Python 3.x.
* Python 3.4 has been deprecated and was removed from the HPC2015 system.
Python packages available in HPC clusters
|pip||python package installer|
|ipython||high performance tools for parallel computing|
|numpy||fundamental package for numerical computation|
|scipy||fundamental library for scientific computing|
|matplotlib||2D plotting library|
|biopython||tools for biological computation|
|sympy||library for symbolic mathematics|
|Cython||C extensions for python|
|mpi4py||supports the full implementation of MPI standard|
|multiprocessing||supports process-based “threading” on multicore machine|
There are many installed packages do not list in the table. You can get the up-to-date installed package information with commands:
– To list installed packages:
– To list outdated packages and show the latest version available:
pip list --outdated
– To show details of an installed packages:
pip show PackageName
Install Python packages locally in home directory
In some cases, you may want to install some python packages locally. To install add-on package under your home directory, you can:
- Install python package by command:
pip install --user PackageName
pip3 install --user PackageName
- You can then find the python package installed under directory
$HOME/.local/lib/pythonx.y/site-packages/. The exact path can be obtained by command:
python -m site --user-site
python3 -m site --user-site
- Upgrade python package by command:
pip install --user --upgrade PackageName
pip3 install --user --upgrade PackageName
Please note that Anaconda is also available as modules in the HPC system. User who want to manage your own python environment/packages is recommended to use Anaconda.
Should you have any problems or issues in the package installation, please contact the system administrator for assistance.