Spot the current directory ( <snip>/build/lib.linux-i686-2.4) in the path:
<snip>/build/lib.linux-i686-2.4$ echo $PYTHONPATH /home/flub/lib/python:/home/flub/lib/python2.4: <snip>/build/lib.linux-i686-2.4$ python Python 2.4.3 (#2, Apr 27 2006, 14:43:58) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', '<snip>/build/lib.linux-i686-2.4', '/home/flub/lib/python', '/home/flub/lib/python2.4', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages', '/usr/lib/site-python'] >>> Ctrl-D <snip>/build/lib.linux-i686-2.4/$ ipython In :import sys In :sys.path Out: ['', '/usr/bin', '/home/flub/lib/python', '/home/flub/lib/python2.4', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '<snip>/build/lib.linux-i686-2.4', '/usr/lib/site-python', '/home/flub/.ipython', '/usr/lib/python2.4/site-packages/IPython/Extensions'] In : Ctrl-D <snip>/build/lib.linux-i686-2.4$
This seriously screws up my interactive sessions with ipython since the module in /usr/lib gets loaded before my own modified one. Why does ipython think it is a good idea to do it that way?
Since we're at the subject, notice the PYTHONPATH environment variable. Why does just the existence of this variable -- what it is set to does actually not matter at all -- make the current directory show up in the path. Also what's the point of the empty ('') string at the beginning of the path? What does that do?
Lots of questions, I know, but I haven't found any of the answers anywhere so far. Maybe I have just looked to hard, but I'm very intrigued.