My situation is as follows:
- I have a locally installed version of python. There exists also a global one, badly installed, which I do not want to use. (I don't have admin priviliges).
- On
/usr/local/lib/site-packages
there is ax.pth
file containing a path to a faulty installation of numpy - My PYTHONPATH does not have any of those paths. However, some admin generated script adds
/usr/local
and/usr/local/bin
to my PATH (this is an assumption, not a known fact). - This somehow results in the faulty-numpy-path added to my
sys.path
. When I runpython -S
, it's not there. site.PREFIXES
does not include/usr/local
. I have no idea why the aforementioned pth file is loaded.- I tried adding a pth file of my own, to the local installation's site-packages dir, doing
import sys; sys.path.remove('pth/to/faulty/numpy')
This fails because when that pth file is loaded, the faulty path is not yet in sys.path.
Is there a way for me to disable the loading of said pth file, or remove the path from sys.path before python is loaded?
I've tried setting up virtualenv and it does not suit my current situation.