Translations of this page:

Install Python libraries

If you need to use some specific Python library which is not available already you have couple different options. First one is to install custom version of Python to your home directory with necessary libraries. Second is to use some version Python which is already installed on servers and just install necessary libraries.

Single user

If you are only user to need this feature just install libraries to your home directory. Use virtual environment for example or adapt following to your needs and create your own custom modules under your home directory.

Multiple users

First ask admin to create necessary directories. Three different directories are created to common space and one of them contains source and build directories. Other is actual installation directory where installed software is available for all users. Third is directory for module file so that necessary path settings can be applied etc.

Example: User named someuser want to install following Python library: LUTPythonlib-0.5 and to use Python-3.7.x

Admin creates directory /shared/install/python-plugins/LUTPythonlib to store different versions and builds etc.:

[someuser@celaeno ~] ll /shared/install/python-plugins/LUTPythonlib
drwxr-xr-x 7 someuser someusergroup 62 14.12.2016 LUTPythonlib

Admin creates directory /shared/libs/python-plugins/Python-3.7/LUTPythonlib where calculation code is going to be installed:

[someuser@celaeno ~] ll /shared/libs/python-plugins/Python-3.7/LUTPythonlib
drwxr-xr-x 7 someuser someusergroup 62 14.12.2016 LUTPythonlib

Admin creates directory for module file:

[someuser@celaeno ~] ll /shared/modules/python-plugins/Python-3.7/LUTPythonlib
drwxr-xr-x 7 someuser someusergroup 62 14.12.2016 LUTPythonlib

Build process

Use calculation nodes for all build tasks:

srun -p phase1 -N 1 -n 1 -c 12 -t 02:00:00 --pty $SHELL

Create module file from template:

cd /shared/modules/python-plugins/Python-3.7/LUTPythonlib
cp /shared/install/python-plugins/pythonplugintemplate.lua 0.5.lua
nano 0.5

Load Python and module for current library:

module load Python/3.7
module load python-plugins/Python-3.7/LUTPythonlib/0.5

After modifying template get source code of LUTPythonlib to build directory:

cd /shared/install/python-plugins/LUTPythonlib
wget http://.../LUTPythonlib-0.5.tar.gz
tar -xvf LUTPythonlib-0.5.tar.gz
cd LUTPythonlib-0.5

Build and install process can be started by:

python3 build install --prefix /shared/libs/python-plugins/Python-3.7/LUTPythonlib/0.5
/opt/webdata/webroot/wiki/data/pages/en/hpc/software/pythonlibs.txt · Last modified: 2018/11/16 19:06 by vrintala
[unknown button type]
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki