Skip to content
This repository

ipython does not start -- DistributionNotFound #814

Closed
countvajhula opened this Issue · 8 comments

4 participants

Siddhartha Kasivajhula Thomas Kluyver Tim Bateman Min RK
Siddhartha Kasivajhula

Hi there,
I've been using ipython for a while (awesome work!), but I just noticed that it isn't working anymore. When I run ipython, I get this output:

Traceback (most recent call last):
File "/usr/local/bin/ipython", line 5, in
from pkg_resources import load_entry_point
File "/Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2603, in

File "/Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 666, in require

File "/Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 565, in resolve

pkg_resources.DistributionNotFound: ipython==0.10.1

I installed a handful of (unrelated) packages in the last couple of weeks so that could have caused this to break somehow. In particular, I installed setuptools, and that seems to be referenced here in the error message.

Thanks,
-Sid

Thomas Kluyver
Collaborator

I think it is likely that installing setuptools has somehow interfered with your setup. Have you tried reinstalling IPython?

Siddhartha Kasivajhula

Yes, I tried reinstalling by doing:

$ sudo easy_install-2.6 readline ipython

...on my mac, which is how I'd installed it the first time around. The installation completed without complaint, but running ipython results in the same error message as before.

Thomas Kluyver
Collaborator

Did it actually reinstall? If easy_install finds an existing installation, it won't do anything. I think you need to do sudo easy_install-2.6 -U ipython or something similar, to force it to install a new version. Note that this will also upgrade you to 0.11 - if you know you have a specific requirement for 0.10.x, you can manually download it from the website.

Siddhartha Kasivajhula

Thanks for the tip. From a cursory look around, it appears that -U is the correct flag for upgrading a package. I tried that, and it seemed to reinstall ipython:

Best match: ipython 0.11
Downloading http://archive.ipython.org/release/0.11/ipython-0.11-py2.6.egg
Processing ipython-0.11-py2.6.egg
removing '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ipython-0.11-py2.6.egg' (and everything under it)
creating /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ipython-0.11-py2.6.egg
Extracting ipython-0.11-py2.6.egg to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
ipython 0.11 is already the active version in easy-install.pth
Installing ipcontroller script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing iptest script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing ipcluster script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing ipython script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing pycolor script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing iplogger script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing irunner script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing ipengine script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing ipython-qtconsole script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin

Installed /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ipython-0.11-py2.6.egg
Processing dependencies for ipython
Finished processing dependencies for ipython

However, running ipython still gives that error message :(

So I tried uninstalling ipython:

$ sudo easy_install-2.6 -m ipython

And then reinstalling:

$sudo easy_install-2.6 ipython
install_dir /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/
Searching for ipython
Reading http://pypi.python.org/simple/ipython/
Reading http://ipython.scipy.org
Reading http://ipython.scipy.org/dist
Reading http://ipython.scipy.org/dist/0.10
Reading http://ipython.scipy.org/dist/0.9.1
Reading http://ipython.scipy.org/dist/0.8.4
Reading http://ipython.org
Reading http://archive.ipython.org/release/0.11/
Reading http://ipython.scipy.org/dist/old/0.9
Best match: ipython 0.11
Downloading http://archive.ipython.org/release/0.11/ipython-0.11-py2.6.egg
Processing ipython-0.11-py2.6.egg
creating /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ipython-0.11-py2.6.egg
Extracting ipython-0.11-py2.6.egg to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
Adding ipython 0.11 to easy-install.pth file
Installing ipcontroller script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing iptest script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing ipcluster script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing ipython script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing pycolor script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing iplogger script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing irunner script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing ipengine script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
Installing ipython-qtconsole script to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin

Installed /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ipython-0.11-py2.6.egg
Processing dependencies for ipython
Finished processing dependencies for ipython

...but I still get the error:


$ipython
Traceback (most recent call last):
  File "/usr/local/bin/ipython", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2603, in <module>

  File "/Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 666, in require

  File "/Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 565, in resolve

pkg_resources.DistributionNotFound: ipython==0.10.1

Thomas Kluyver
Collaborator

It looks like it's installing the start scripts to a location later in your path than an existing entry. You might want to try deleting /usr/local/bin/ipython.

I'm going to close this issue since I don't think it's an IPython bug. We can still comment on it after it's closed.

Thomas Kluyver takluyver closed this
Tim Bateman

just in case someone else comes across here via google (like i did!), I too installed ipython from pip3 but the
the ipython script (/usr/local/bin/ipython on my box) wasn't correct.

The required version was wrong:

__requires__ = 'ipython==0.10.2'

instead of:

__requires__ = 'ipython==0.13.1'

and:

load_entry_point('ipython==0.10.2', 'console_scripts', 'ipython')()

instead of:

load_entry_point('ipython==0.13.1', 'console_scripts', 'ipython3')()

I've obviously install ipython v0.13.1

I'm a complete python n00b - but hopefully that correct and helps someone...

Min RK
Owner

@farproc that means that /usr/local/bin/ipython is not actually the file that the installer wrote - check the installer output. Most significantly, pip3 will actually create ipython3, it will not create any file called ipython.

Deleted user
ghost commented

The content you are editing has changed. Reload the page and try again.

I explicitly use pip3 instead of pip, it will work.

 pip3 install ipython
 pip3 install ipdb 
Sending Request…

Attach images by dragging & dropping or selecting them. Octocat-spinner-32 Uploading your images… Unfortunately, we don't support that file type. Try again with a PNG, GIF, or JPG. Yowza, that's a big file. Try again with an image file smaller than 10MB. This browser doesn't support image attachments. We recommend updating to the latest Internet Explorer, Google Chrome, or Firefox. Something went really wrong, and we can't process that image. Try again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.