Update Python on JSC machines authored by Johannes Keller's avatar Johannes Keller
There are two main recommendations for using Python on JSC machines:
1. Use the `module` environment to load major Python modules: https://apps.fz-juelich.de/jsc/hps/jureca/compile.html#python
2. Use Python virtual environments on `$PROJECT` or `$SCRATCH`
For start-up it is beneficial to run the following `module` commands
```
module load Python
module load SciPy-Stack
```
and for graphics
```
module load matplotlib
module load PyQt5
```
This will give you a good starting point.
# Looking for Python modules on JSC machines
Maybe the general Python configuration does not provide all the Python modules you need. Then, you can take the following steps, looking for the Python module `pyxyz`
1. Search for a JSC module containing the Python module: `module keyword pyxyz`. If you find one, for example called `XYZ/2024`, load the module using `module load XYZ/2024`
2. Make a Python virtual environment under `$PROJECT/$USER`: `python -m venv $PROJECT/$USER/pyvenv` and activate it (`source $PROJECT/$USER/pyvenv/bin/activate`) before running the pip install command `pip install pyxyz`. This way the Python module will not be saved in `$HOME`, where there is not much space. The Python virtual environment can be closed by the command `deactivate`.
\ No newline at end of file