User Tools

Site Tools


working_with_python

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
working_with_python [2018/08/30 07:49] – [Bypassing the existing python environment] lenocilworking_with_python [2018/08/30 07:49] – [Bypassing the existing python environment] lenocil
Line 252: Line 252:
 ====== 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
working_with_python.txt · Last modified: 2023/11/06 13:12 by jansen