Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision |
working_with_python [2018/08/30 07:49] – [Bypassing the existing python environment] lenocil | working_with_python [2018/08/30 07:49] – [Bypassing the existing python environment] lenocil |
---|
====== Bypassing the existing python environment ====== | ====== Bypassing the existing python environment ====== |
Occasionally, something in the systemwide directories (e.g ''/software/local/lib64/python2.7/site-packages'') interferes with your python application. Perhaps you have a code that requires a specific, older, version of numpy or matplotlib. Just installing that version is not always sufficient. The trick is, to set the PYTHONPATH to point first to a directory where you place a private ''sitecustomize.py'' which then overrides the one we have placed in /usr/lib64/python2.7/site-packages (which is where we add the /software directories to the path for everyone). Here is how: | Occasionally, something in the systemwide directories (e.g ''/software/local/lib64/python2.7/site-packages'') interferes with your python application. Perhaps you have a code that requires a specific, older, version of numpy or matplotlib. Just installing that version is not always sufficient. The trick is, to set the PYTHONPATH to point first to a directory where you place a private ''sitecustomize.py'' which then overrides the one we have placed in /usr/lib64/python2.7/site-packages (which is where we add the /software directories to the path for everyone). Here is how: |
<code sh> | <code bash> |
mkdir /some/location/python_custom_dir | mkdir /some/location/python_custom_dir |
setenv PYTHONPATH /some/location/python_custom_dir:/usr/lib64/python2.7/site-packages | setenv PYTHONPATH /some/location/python_custom_dir:/usr/lib64/python2.7/site-packages |