简体   繁体   中英

Module load-PATH-env variables

I'm currently working on a remote server (through ssh) and I need to load some modules (module load [package1][package2] ecc). Specifically, it's required the numpy version 1.15.2, but in the directory containing all the numpy versions there are only 1.14.0 versions.

Anyway, I was able to get the package numpy/1.15.2--python--3.6.4 (which I obviously don't have permission to copy in the directory containing the other versions of numpy) so I was wondering if I could (and how) temporarely change the enviromental variable path in order to specify, only in that case, where the "module load" should look for, instead of the usual repository like for other modules.

temporarely change the enviromental variable path

I think the easiest would be to create a subshell with the modified PATH and work in that:

PATH=modifiedpath bash 

Whether this works or not, depends on what exactly you are doing in your.bashrc with your PATH. If you reassinged there the old PATH, your changes would be lost and in this case, you could instead do a

PATH=modifiedpath bash --norc

to bypass soucring.bashrc. Of course this means aliases, functions and non-exported variables from your.bashrc aren't available either.

If this too causes a problem, you could stay in your shell, but temporarily safe the PATH:

origpath=$PATH
PATH=modifiedpath
... do your work
PATH=$origpath # restore it

You could have your own modulepath that supersedes the modulepaths provided by the admins on the system you use.

Just create a directory structure, then add your own numpy/version modulefile in it (such modulefile should define the environment variables to use your specific installation of the numpy package).

$ mkdir ~/modulefiles
$ mkdir ~/modulefiles/numpy
$ $EDITOR ~/modulefiles/numpy/<version>

Then enable this modulepath in your current shell session:

$ module use ~/modulefiles

Lastly added modulepath gets higher priority, so when you will perform the module load numpy command it will load your specific numpy modulefile instead of the numpy modulefile provided by default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM