【问题标题】:Qt programs (Canopy GUI, ipython qtconsole) crash in Enthought Canopy Win7 64BitsQt 程序(Canopy GUI、ipython qtconsole)在 Enthought Canopy Win7 64Bits 中崩溃
【发布时间】:2023-04-10 12:07:01
【问题描述】:

我在 Windows 7 - 64 位上安装了 Canopy 1.5.2。我执行了Enthought web page 中描述的所有步骤,但 Canopy GUI 无法启动。我意识到问题与 Qt 有关,因为不需要此类程序的应用程序(如 Mayavi、Pylab 等)可以完美运行。当我尝试跑步时,p.e. ipython qtconsole,控制台显示如下:

D:\Enthought\Canopy\User\Scripts>ipython qtconsole
Error in sys.excepthook:
Traceback (most recent call last):
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\qt\console\qtconsolea
pp.py", line 45, in gui_excepthook
    old_excepthook(exctype, value, tb)
TypeError: 'NoneType' object is not callable

Original exception was:
Traceback (most recent call last):
  File "C:\Program Files\Enthought\Canopy\App\appdata\canopy-1.5.2.2785.win-x86_
64\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Program Files\Enthought\Canopy\App\appdata\canopy-1.5.2.2785.win-x86_
64\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\__main__.py", line 14
, in <module>
    start_ipython()
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\__init__.py", line 12
0, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\config\application.py
", line 573, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\config\application.py
", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\terminal\ipapp.py", l
ine 321, in initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\config\application.py
", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\core\application.py",
 line 369, in initialize
    self.parse_command_line(argv)
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\terminal\ipapp.py", l
ine 316, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "<string>", line 2, in parse_command_line
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\config\application.py
", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\config\application.py
", line 471, in parse_command_line
    return self.initialize_subcommand(subc, subargv)
  File "<string>", line 2, in initialize_subcommand
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\config\application.py
", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\config\application.py
", line 402, in initialize_subcommand
    subapp = import_item(subapp)
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\utils\importstring.py
", line 42, in import_item
    module = __import__(package, fromlist=[obj])
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\qt\console\qtconsolea
pp.py", line 50, in <module>
    from IPython.external.qt import QtCore, QtGui
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\external\qt.py", line
 23, in <module>
    QtCore, QtGui, QtSvg, QT_API = load_qt(api_opts)
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\external\qt_loaders.p
y", line 277, in load_qt
    result = loaders[api]()
  File "D:\Enthought\Canopy\User\lib\site-packages\IPython\external\qt_loaders.p
y", line 229, in import_pyside
    from PySide import QtGui, QtCore, QtSvg
ImportError: DLL load failed: No se puede encontrar el m¾dulo especificado.

D:\Enthought\Canopy\User\Scripts>

,但是当我启动ipython notebook 时,一切正常。我还使用enpkg 更新了所有软件包。我很感激任何帮助。提前致谢。

更新:我设置了set QT_API = pyqt,现在我可以运行ipython qtconsoleipython qtconsole -pylab=qt。但我仍然无法运行 Canopy GUI(代码编辑器或包管理器)。

【问题讨论】:

    标签: python qt pyside enthought canopy


    【解决方案1】:

    通常这个错误意味着 PySide 要么无法找到 Qt DLL,要么它找到的不是正确的版本并且没有一些预期的符号。您的系统上的 PATH 某处是否还有其他一组 Qt 库?您可以使用 Dependency Walker 工具检查 PySide *.pyd 文件,以查看它正在搜索的其他 DLL 以及它加载的那些。

    【讨论】:

    • 非常感谢您的回答。我没有安装任何 Qt,除了使用enpkg 安装的 qt 包。我听从了你的建议,当我检查 QtCore.pyd 的 Dependency Walker Tools 时,看起来问题与 API-MS-WIN dll 有关。基于this,我检查了我的 Visual Studio C++ 安装,我已经有了 2013 版本。我怎样才能安装这个dll?感谢您的宝贵时间...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多