我正在使用IPython 0.13.2,我想在QT控制台上试用IPython。但是,在PySide上执行easy_install后,它安装了1.2.0版本。做ipython qtconsole仍然会出现同样的错误:
File "c:\python27\lib\site-packages\IPython\config\application.py", line 352, in initialize_subcommand
subapp = import_item(subapp)
File "c:\python27\lib\site-packages\IPython\utils\importstring.py", line 40, in import_item
module = __import__(package,fromlist=[obj])
File "c:\python27\lib\site-packages\IPython\frontend\qt\console\qtconsoleapp.py", line 56, in <module>
from IPython.external.qt import QtCore, QtGui
File "c:\python27\lib\site-packages\IPython\external\qt.py", line 57, in <module>
raise ImportError('Cannot import PySide >= 1.0.3 or PyQt4 >= 4.7')
ImportError: Cannot import PySide >= 1.0.3 or PyQt4 >= 4.7
然而,当我启动IPython并尝试导入PySide时,它看起来很好:
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.
IPython 0.13.2 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import PySide
In [2]: PySide.__version__
Out[2]: '1.2.0'
In [3]:
是什么给出的?我在Windows XP上,使用Console2(在IPython网站上推荐),但也尝试使用相同结果的命令提示符。
答案 0 :(得分:0)
发现问题:
我需要先从Python 2.7.3升级到Python 2.7.5,因为PySide 1.2是用2.7.5构建的。
之后,我只需要在pygments上做easy_install
然后ipython qtconsole
工作正常!