[IPython-dev] Weird PYTHONPATH, etc. issue

David Warde-Farley d.warde.farley at gmail.com
Wed Sep 19 17:11:16 EDT 2012

So, this is partly caused by the details of PEP 370, but I'm raising
it in an issue because it seems like there might be some way to
rectify it on IPython's side.

Essentially, our sysadmin has 0.13 installed in a site-packages
directory that he adds to the PYTHONPATH via global bashrc stuff (I
could remove it in my own ~/.bashrc, but it's a pain). I wanted to use
git master, so I installed it with "python setup.py develop --user".
What I didn't realize until just now reading PEP 370 is that
~/.local/foo is scanned *after* PYTHONPATH. So if I simply issue
"python" and "import IPython", I get 0.13.

Now, here's the fun part: because of some pkg_resources funny
business, when I do "ipython" and launch the terminal version, I get
0.14.dev. However, if I run "ipython notebook" or "ipython qtconsole",
I get all sorts of errors printing to the c onsole referencing the
version on the PYTHONPATH. I assume this has to do with the kernel
process forking off, and whatever pkg_resources funny-business not
being inherited in that process.

So, the straightforward answer is for me to just prepend ~/src/ipython
to my PYTHONPATH, but I'm a little weary of this situation of
IPython-terminal and IPython-client-server behaving differently even
when invoked with the same script.

So, is there any way we can ensure that both processes are loading the
same version of the IPython module?



More information about the IPython-dev mailing list