0

我在 Ubuntu 12.10 中创建了一个 virtualev (~/ENV),使用 --system-site-packages 选项,我使用 pip sphynx 和 pyzmq 安装(安装 spyder 所必需的),然后是 spyder 本身,然后是 ipython(也尝试反向命令)。Spyder 在没有 Ipython 的情况下可以正常工作,但是当我在安装 Ipython 后尝试运行它时,它给出了 ImportError:

zdk1g12@walrus:~$ source ENV/bin/activate
(ENV)zdk1g12@walrus:~$ spyder
Traceback (most recent call last):
  File "/home/zdk1g12/ENV/bin/spyder", line 3, in <module>
    start_app.main()
  File "/home/zdk1g12/ENV/local/lib/python2.7/site-packages/spyderlib/start_app.py", line 64, in main
    from spyderlib import spyder
  File "/home/zdk1g12/ENV/local/lib/python2.7/site-packages/spyderlib/spyder.py", line 95, in <module>
    from spyderlib.plugins.inspector import ObjectInspector
  File "/home/zdk1g12/ENV/local/lib/python2.7/site-packages/spyderlib/plugins/inspector.py", line 36, in <module>
    from spyderlib.widgets.ipython import IPythonControlWidget
  File "/home/zdk1g12/ENV/local/lib/python2.7/site-packages/spyderlib/widgets/ipython.py", line 12, in <module>
    from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget
  File "/home/zdk1g12/ENV/local/lib/python2.7/site-packages/spyderlib/widgets/IPython.py", line 12, in <module>
    from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget
ImportError: No module named frontend.qt.console.rich_ipython_widget

from spyderlib import spyder当我从控制台尝试时,它给出了同样的错误。但是,如果在下一行(同一个控制台,就在错误之后)我这样做:

from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget

......它工作得很好!

一些细节:

In [3]: import spyderlib; spyderlib.__version__
Out[3]: '2.2.0rc'
In [6]: import IPython; IPython.__version__
Out[6]: '0.13.2'
In [8]: import sys; sys.executable
Out[8]: '/home/zdk1g12/ENV/bin/python'

In [9]: import sys; sys.path
Out[9]: 
['/home/zdk1g12/ENV/local/lib/python2.7/site-packages/spyderlib/utils/external',
 '',
 '',
 '/home/zdk1g12/ENV/bin',
 '/home/zdk1g12/ENV/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg',
 '/home/zdk1g12/ENV/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg',
 '/home/zdk1g12/ENV/lib/python2.7',
 '/home/zdk1g12/ENV/lib/python2.7/plat-linux2',
 '/home/zdk1g12/ENV/lib/python2.7/lib-tk',
 '/home/zdk1g12/ENV/lib/python2.7/lib-old',
 '/home/zdk1g12/ENV/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/home/zdk1g12/ENV/local/lib/python2.7/site-packages',
 '/usr/local/lib/python2.7/site-packages',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PIL',
 '/usr/lib/python2.7/dist-packages/gst-0.10',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/pymodules/python2.7',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-couch',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol',
 '/home/zdk1g12/ENV/local/lib/python2.7/site-packages/IPython/extensions']

Ipython 工作正常,qtconsole 也是如此。

4

0 回答 0