【问题标题】:pyside pyqt4 conflict in ipython when running morphotester.py运行morphotester.py时ipython中的pyside pyqt4冲突
【发布时间】:2016-11-01 17:15:58
【问题描述】:

尝试在 Canopy 中运行一个包,当我运行该包时,它会导致冲突,因为 pyside 似乎是默认的,而该包调用 pyqt4,如何在 Ipython 中禁用 pyside,或以其他方式处理该问题?

%run "C:\Users\Tom\Desktop\morphotester-master\morphotester-master\Morpho.py"
C:\Users\Tom\AppData\Local\Enthought\Canopy\User\lib\site-packages\matplotlib\__init__.py:1350: UserWarning:  This call to matplotlib.use() has no effect
because the backend has already been chosen;
matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

  warnings.warn(_use_error_msg)
WARNING:traits.has_traits:DEPRECATED: traits.has_traits.wrapped_class, 'the 'implements' class advisor has been deprecated. Use the 'provides' class decorator.
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
C:\Users\Tom\Desktop\morphotester-master\morphotester-master\Morpho.py in <module>()
     25 from mayavi.core.ui.api import MlabSceneModel
     26 from tvtk.pyface.scene_editor import SceneEditor
---> 27 from PyQt4 import QtGui
     28 
     29 class MainWidget(QtGui.QWidget):

C:\Users\Tom\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.6.2.3262.win-x86_64\lib\site-packages\IPython\external\qt_loaders.pyc in load_module(self, fullname)

ImportError: 
    Importing PyQt4 disabled by IPython, which has
    already imported an Incompatible QT Binding: pyside

【问题讨论】:

标签: ipython pyqt4 pyside canopy


【解决方案1】:

在 Canopy / Edit / Preferences / Python 中,禁用 Pylab 模式,或将其设置为“Inline (SVG)”

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-10-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多