2014-01-20 26 views
0

我有Enthought Python Distribution的學術許可證,當我嘗試運行ipython時遇到了一個奇怪的錯誤。下面是一些我看到的行爲:IPython Enthought Python Distribution發佈錯誤

$ 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' 
>>> 

當我運行enpkg enstaller,它更新IPython的,它看上去像一切工作正常。

$ 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 

任何幫助或建議我可以做些什麼來讓ipython再次工作?

回答

0

環顧四周後,我發現一個問題,有人說另一個安裝ipython可能會導致問題。 enpkg試圖安裝ipython 1.1.0,但我仍然有0.13.1左右。因此,我通過刪除它:

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

然後裝有約kernmagic這樣的錯誤:

$ sudo enpkg kernmagic 

它在某種程度上重新安裝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. 

所以,簡單地重新嘗試enpkg命令安裝最新版本。

$ 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. 

現在它運行沒有錯誤。所以,希望這可以幫助任何人解決這些問題。

1

同樣的問題在我的Enthought Python Distribution的學術許可證上。我遵循回答中列出的步驟,並可以確認現在一切正常。 Enthought Knowledge Base上沒有提到這個解決方案。謝謝!

答案之一:爲了找到需要從系統中刪除的目錄。 。 。

$ python 
import IPython 
print IPython