[IPython-User] strange behavior in virtualenv?

Johann Cohen-Tanugi johann.cohen-tanugi@lupm.univ-montp2...
Thu Sep 22 17:38:14 CDT 2011


hello, I have some trouble understanding the following behavior of ipython :
I am in a virtualenv setup for which I installed the master of ipython. 
My virtualenv is in /home/cohen/sources/python/scipydev/

If I type :
(scipydev)cohen@jarrett:~/sources/python/scipydev$ 
/home/cohen/sources/python/scipydev/bin/ipython
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
Type "copyright", "credits" or "license" for more information.

IPython 0.12.dev -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import sys

In [2]: sys.path
Out[2]:
['',
  '/home/cohen/sources/python/scipydev/bin',
<clip>
and things behave ok down the road (say some updated scipy stuff that I 
do not have outside of the virtualenv).

But then if I do :
(scipydev)cohen@jarrett:~/sources/python/scipydev$ which ipython
/home/cohen/sources/python/scipydev/bin/ipython
(scipydev)cohen@jarrett:~/sources/python/scipydev$ ipython
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
Type "copyright", "credits" or "license" for more information.

IPython 0.11 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import sys

In [2]: sys.path
Out[2]:
['',
  '/usr/local/bin',
<clip>
and things go awry because the stuff in 
/home/cohen/sources/python/scipydev/lib is overridden by the stuff in 
/usr/local/lib.....

Why is the call to ipython here behaving differently than the call to 
/home/cohen/sources/python/scipydev/bin/ipython, when they are supposed 
to point to the same place?

thanks for any hindsight,
Johann


More information about the IPython-User mailing list