linux_environment_modules
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
linux_environment_modules [2020/08/27 11:09] – pgh5a | linux_environment_modules [2023/09/18 11:50] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Software Modules ===== | ||
+ | [[http:// | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ==== Virtual Environments ==== | ||
+ | For most Python related packages (i.e. pip install ...), it is often more applicable to utilize a virtual environment. This can be done with [[ https:// | ||
+ | or [[ https:// | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ==== Jupyter Notebook ==== | ||
+ | A Jupyter Notebook interface can be loaded using a virtual environment (as described above). This is best done using a [[ https:// | ||
+ | < | ||
+ | [abc1de@labsrv03 ~]$ module load anaconda3 | ||
+ | </ | ||
+ | Then, load Jupyter Notebook: | ||
+ | < | ||
+ | [abc1de@labsrv03 ~]$ Jupyter Notebook | ||
+ | </ | ||
+ | Follow the link given to you by the Notebook Server to access the interface: | ||
+ | < | ||
+ | [W 12: | ||
+ | [I 12: | ||
+ | [I 12: | ||
+ | [I 12: | ||
+ | [I 12: | ||
+ | [I 12: | ||
+ | [C 12: | ||
+ | | ||
+ | To access the notebook, open this file in a browser: | ||
+ | file:/// | ||
+ | for example... | ||
+ | file:/// | ||
+ | </ | ||
+ | |||
+ | ==== How Modules Work ==== | ||
+ | Environment modules modify Environment Variables of the Linux Shell. Environment variables typically are paths to executables, | ||
+ | |||
+ | ==== Using Software Modules ==== | ||
+ | Type '' | ||
+ | |||
+ | < | ||
+ | [abc1de@portal04 ~]$ module avail | ||
+ | ---- / | ||
+ | anaconda3 | ||
+ | java17-17.0.1 | ||
+ | python3 | ||
+ | </ | ||
+ | |||
+ | Load the software module using '' | ||
+ | |||
+ | < | ||
+ | abc1de@portal04 ~ $ module load python3 | ||
+ | abc1de@portal04 ~ $ which python3 | ||
+ | / | ||
+ | abc1de@portal04 ~ $ python3 | ||
+ | Python 3.10.12 (main, Jun 14 2023, 10:18:49) [GCC 11.3.0] on linux | ||
+ | Type " | ||
+ | >>> | ||
+ | </ | ||
+ | |||
+ | '' | ||
+ | |||
+ | < | ||
+ | abc1de@portal ~ $ module load matlab | ||
+ | abc1de@portal ~ $ module load php | ||
+ | abc1de@portal ~ $ module list | ||
+ | Currently Loaded Modulefiles: | ||
+ | 1) matlab | ||
+ | </ | ||
+ | |||
+ | '' | ||
+ | |||
+ | < | ||
+ | abc1de@portal ~ $ module display python | ||
+ | ------------------------------------------------------------------- | ||
+ | / | ||
+ | |||
+ | module-whatis Python current | ||
+ | prepend-path PATH / | ||
+ | prepend-path LD_LIBRARY_PATH / | ||
+ | prepend-path LD_INCLUDE_PATH / | ||
+ | prepend-path MANPATH / | ||
+ | ------------------------------------------------------------------- | ||
+ | abc1de@portal ~ $ echo $LD_LIBRARY_PATH | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Use '' | ||
+ | |||
+ | < | ||
+ | abc1de@portal ~ $ module switch python3 python2 | ||
+ | abc1de@portal ~ $ module unload php | ||
+ | </ | ||
+ | |||
+ | ==== Software Module Requests ==== | ||
+ | If a module is needed but not listed, please send an email to cshelpdesk@virginia.edu with the following: | ||
+ | 1. In the subject line, write " | ||
+ | 2. In the body of the email, please include information about the software being requested (version and any associated links) | ||
+ | |||
+ | ==== Shell Scripting/ | ||
+ | If you write shell scripts or slurm batch files that make use of these software packages, remember that you must still load modules from inside of your script. | ||
+ | ==== Using modules in a non-interactive script ==== | ||
+ | When executing a shell script non-interactively, | ||
+ | |||
+ | To fix this, simply include the following line in your scripts: | ||
+ | |||
+ | < | ||
+ | source / | ||
+ | </ | ||
linux_environment_modules.txt · Last modified: 2023/09/18 11:50 by 127.0.0.1