【问题标题】:Pyside2, DLL load failed in samplebinding examplePyside2,示例绑定示例中的 DLL 加载失败
【发布时间】:2020-06-13 14:41:16
【问题描述】:

试图让samplebinding example 工作,但无论使用的编译器、python 还是 pyside 版本,我仍然得到

ImportError: DLL load failed while importing Universe: 找不到指定的模块。

上次使用的配置:

  • VS2019
  • cmake 3.16.2
  • python 3.81 amd64 来自 python.org
  • pyside2, shiboken2 5.14.1 来自 pip
  • shiboken-generator whl 5.14.1 来自here

库正在编译:

【问题讨论】:

  • @eyllanesc 添加到 PATH 或 PYTHONPATH,仍然出现错误。我认为是某种二进制冲突,可能是编译后的 shiboken-generator WHL 和 python 解释器。

标签: python qt5 pyside2 shiboken2


【解决方案1】:

Python 3.8 changed the dll path resolution.

将 shiboken2.abi3.dll 添加到文件夹中解决了该问题。

【讨论】:

    【解决方案2】:

    将导入修改为与 Python3 兼容:

    from build.Universe import Icecream, Truck
    

    __future__.print_function 的导入表明该文件仍然是为 Python2 编写的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-02-02
      • 1970-01-01
      • 1970-01-01
      • 2015-04-19
      • 2013-03-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多