[IPython-dev] Weird PYTHONPATH, etc. issue

Fernando Perez fperez.net at gmail.com
Thu Sep 27 15:16:06 EDT 2012

On Thu, Sep 27, 2012 at 5:59 AM, Erik Bray <erik.m.bray at gmail.com> wrote:
> I don't really see this so much as a setuptools problem though.  Your
> sysadmin shouldn't be using PYTHONPATH for this.

I think there was a misunderstanding; in the case I referred to, the
admin didn't touch pythonpath at all.  There was simply a system-wide
install of EPD, and that (because EPD uses setuptools) rewired
sys.path, making the *user* configuration of PYTHONPATH moot.
PYTHONPATH is a *user* tool, and in this case the user was trying to
use it as intended, but a system-wide setuptools-using package was
messing sys.path at runtime and overriding PYTHONPATH.

That is the behavior of setuptools which is completely unacceptable.

In our case, we were able to work around it by creating a second set
of path entries in sys.path from PYTHONPATH via the usercustomize.py
file.  Ugly as hell, but it got the job done.  I'm not sure why that
didn't work in David's case.

So again, the problem can occur even when sysadmins don't touch
PYTHONPATH at all, simply by virtue of installing any package that
uses setuptools.



More information about the IPython-dev mailing list