0

--system-site-packages オプションを使用して、Ubuntu 12.10 で virtualev (~/ENV) を作成します。ここでは、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