[IPython-dev] ipython+virtualenv

Fernando Perez fperez.net at gmail.com
Sun Jan 17 19:02:16 EST 2010


Hey Satra,

On Sun, Jan 17, 2010 at 8:03 AM, Satrajit Ghosh <satra at mit.edu> wrote:
>
> i installed ipython in a virtual environment. however when i launch it picks
> up the system ipython even though the executable listed by path is the
> virtual one. when i explicitly call the virtual one it starts the virtual
> one.
>
> http://gist.github.com/279433
>
> does iptest check to see that the correct version of ipython is being
> imported? if not, a check might be good.

If you update again, I think I've fixed most of that, which
incidentally was related to some of the failures you and others were
seeing.

But I don't understand what you're seeing there though: that running
`which X` and X produce different results is odd.

Unfortunately I can't test with virtualenvs, because
setuptools/virtualenv seems to have broken on my system:

maqroll[~]> mkvirtualenv --no-site-packages ipythonenv
New python executable in ipythonenv/bin/python
Please make sure you remove any previous custom paths from your
/home/fperez/.pydistutils.cfg file.
Installing setuptools......................
  Complete output from command ipythonenv/bin/python -c "#!python
\"\"\"Bootstrap setuptoo...




" /usr/lib/python2.6/dist-packag...6.egg:
  Downloading http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c9-py2.6.egg
Traceback (most recent call last):
  File "<string>", line 270, in <module>
  File "<string>", line 204, in main
  File "/home/fperez/usr/opt/virtualenv/setuptools-0.6c9-py2.6.egg/setuptools/__init__.py",
line 2, in <module>
  File "/home/fperez/usr/opt/virtualenv/setuptools-0.6c9-py2.6.egg/setuptools/extension.py",
line 2, in <module>
  File "/home/fperez/usr/opt/virtualenv/setuptools-0.6c9-py2.6.egg/setuptools/dist.py",
line 6, in <module>
  File "/usr/lib/python2.6/dist-packages/support-files/setuptools-0.6c9-py2.6.egg/setuptools/command/sdist.py",
line 4, in <module>
  File "/home/fperez/usr/opt/virtualenv/setuptools-0.6c9-py2.6.egg/pkg_resources.py",
line 2582, in <module>
    add_activation_listener(lambda dist: dist.activate())
  File "/home/fperez/usr/opt/virtualenv/setuptools-0.6c9-py2.6.egg/pkg_resources.py",
line 640, in subscribe
    callback(dist)
  File "/home/fperez/usr/opt/virtualenv/setuptools-0.6c9-py2.6.egg/pkg_resources.py",
line 2582, in <lambda>
    add_activation_listener(lambda dist: dist.activate())
  File "/home/fperez/usr/opt/virtualenv/setuptools-0.6c9-py2.6.egg/pkg_resources.py",
line 2131, in activate
    map(declare_namespace, self._get_metadata('namespace_packages.txt'))
  File "/home/fperez/usr/opt/virtualenv/setuptools-0.6c9-py2.6.egg/pkg_resources.py",
line 1735, in declare_namespace
    __import__(parent)
ImportError: No module named enthought
----------------------------------------
...Installing setuptools...done.
Traceback (most recent call last):
  File "/home/fperez/usr/opt/bin/virtualenv", line 8, in <module>
    load_entry_point('virtualenv==1.3.3', 'console_scripts', 'virtualenv')()
  File "/usr/lib/python2.6/dist-packages/virtualenv.py", line 420, in main
    unzip_setuptools=options.unzip_setuptools)
  File "/usr/lib/python2.6/dist-packages/virtualenv.py", line 507, in
create_environment
    install_setuptools(py_executable, unzip=unzip_setuptools)
  File "/usr/lib/python2.6/dist-packages/virtualenv.py", line 295, in
install_setuptools
    cwd=cwd)
  File "/usr/lib/python2.6/dist-packages/virtualenv.py", line 481, in
call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command ipythonenv/bin/python -c "#!python
\"\"\"Bootstrap setuptoo...




" /usr/lib/python2.6/dist-packag...6.egg failed with error code 1
Now you can use workon to activate your new virtualenv


####

The old venvs I have all work, but I can't seem to make new ones
anymore.  I don't really have time right now to debug setuptools
itself, unfortunately.

Cheers,

f



More information about the IPython-dev mailing list