Search code examples
macosenthought

IPython launching error with Enthought Python Distribution


I have an Academic license with Enthought Python Distribution, and I'm getting a strange error when I try to run ipython. Here is some of the behavior I'm seeing:

$ ipython
Traceback (most recent call last):
  File "/Library/Frameworks/EPD64.framework/Versions/Current/bin/ipython", line 8, in <module>
    from IPython import start_ipython
ImportError: cannot import name start_ipython

$ python
Enthought Python Distribution -- www.enthought.com
Version: 7.3-2 (64-bit)

Python 2.7.2 |EPD 7.3-2 (64-bit)| (default, Sep  7 2011, 16:31:15)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "credits", "demo" or "enthought" for more information.
>>> import IPython
>>> IPython.start_ipython()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'start_ipython'
>>>

When I run the enpkg enstaller, it updated ipython and it looked like everything worked OK.

$ sudo enpkg ipython
prefix: /Library/Frameworks/EPD64.framework/Versions/7.2
No update necessary, 'ipython' is up-to-date.
ipython-1.1.0-6.egg was installed on: Sun Jan 19 23:57:27 2014

$ which ipython
/Library/Frameworks/EPD64.framework/Versions/Current/bin/ipython

$ which python
/Library/Frameworks/EPD64.framework/Versions/Current/bin/python

Any help or suggestions what I can do to get ipython to work again?


Solution

  • Ok after looking around, I found a problem where someone said another install of ipython might be causing problems. enpkg is trying to install ipython 1.1.0 but I still had 0.13.1 around. So I removed it via:

    $ sudo rm -rf /Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/ipython-0.13.1-py2.7.egg
    

    Then it loaded with errors about kernmagic so:

    $ sudo enpkg kernmagic
    

    It somehow re-installed ipython 1.0

    $ ipython
    Python 2.7.2 |EPD 7.3-2 (64-bit)| (default, Sep  7 2011, 16:31:15)
    Type "copyright", "credits" or "license" for more information.
    
    IPython 1.0.0 -- An enhanced Interactive Python.
    

    So simply re-trying the enpkg command installs the latest version.

    $ sudo enpkg ipython
    prefix: /Library/Frameworks/EPD64.framework/Versions/7.2
    ipython-1.0.0-2.egg                                                [removing]
     12.84 MB [.................................................................]
    Jinja2-2.6-2.egg                                                   [removing]
      1.58 MB [.................................................................]
    tornado-2.2-1.egg                                                  [removing]
      1.42 MB [.................................................................]
    tornado-3.1.1-1.egg                                              [installing]
      2.16 MB [.................................................................]
    Jinja2-2.7.1-1.egg                                               [installing]
      1.62 MB [.................................................................]
    ipython-1.1.0-6.egg                                              [installing]
     12.92 MB [.................................................................]
    
    $ ipython
    Python 2.7.2 |EPD 7.3-2 (64-bit)| (default, Sep  7 2011, 16:31:15)
    Type "copyright", "credits" or "license" for more information.
    
    IPython 1.1.0 -- An enhanced Interactive Python.
    

    And now it runs without errors. So, hopefully that helps anyone else coming across these kinds of problems.