This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
working_with_python [2020/10/05 10:31] – [Example: how to let python search arbitrary library paths] lenocil | working_with_python [2020/10/06 06:55] – [METHOD 1: pip with the `--user' option] jansen | ||
---|---|---|---|
Line 81: | Line 81: | ||
export PYTHONUSERBASE=$HOME/ | export PYTHONUSERBASE=$HOME/ | ||
fi | fi | ||
- | For users of the '' | + | For users of the '' |
if (! -f / | if (! -f / | ||
setenv PYTHONUSERBASE $HOME/ | setenv PYTHONUSERBASE $HOME/ | ||
Line 168: | Line 168: | ||
All '' | All '' | ||
- | ===== Example: how to create | + | ===== Example: how to create |
- | First enable the module package to search also private module directories | + | Please read [[easybuild_environment|here]]. |
- | <code bash> | + | |
- | module load use.own | + | |
- | </ | + | |
- | the line above will create a $HOME/ | ||
- | |||
- | Let us now install some packages to an arbitrary location and upgrade (__only in $PYTHONUSERBASE__) an already system-wide installed package | ||
- | |||
- | <code bash> | ||
- | export PYTHONUSERBASE=/ | ||
- | pip install --user SomePackage | ||
- | pip install -I --user SomePackageThatWASInstalledSystemwide | ||
- | </ | ||
- | |||
- | Create a file, say `$HOME/ | ||
- | <code bash> | ||
- | #%Module 1.0 | ||
- | # | ||
- | # | ||
- | # | ||
- | prepend-path | ||
- | prepend-path | ||
- | </ | ||
- | |||
- | and type | ||
- | |||
- | <code bash> | ||
- | module load super-module | ||
- | </ | ||
- | and you are ready to use your newly created python environment. Note that is similar procedure can be repeated using python3. | ||
===== Example: numpy with openBLAS ===== | ===== Example: numpy with openBLAS ===== | ||
In this example we create a python2 virtual environment in which we will install the latest version of numpy that will use the openBLAS library. | In this example we create a python2 virtual environment in which we will install the latest version of numpy that will use the openBLAS library. |