【问题标题】:How to get SIP to find .sip files for and installed library如何让 SIP 找到 .sip 文件并安装库
【发布时间】:2009-11-12 21:24:43
【问题描述】:

我正在尝试使用 sip 为 source-highlight-qt 创建 python 绑定。

我正在使用 ubuntu - 我已经安装了 python-qt4-dev,它已将 pyqt sip 文件安装到 /usr/share/sip/PyQt4/

在我的 sip 文件中,我有这个导入:

%Import QtCore/qstring.sip

我在运行 configure.py 时遇到此错误:

sip: Unable to find file "QtCore/qstring.sip"

我如何通过 sip 找到 pyqt .sip 文件?

【问题讨论】:

    标签: pyqt


    【解决方案1】:

    我就是这样解决的:

    在我的 configure.py 中,我需要创建一个 pyqtconfig:

    from PyQt4 import pyqtconfig
    config = pyqtconfig.Configuration()
    

    然后为 sip 添加目录以包含:

    command = " ".join(
        [config.sip_bin, "-c", ".", "-b", build_file,
         "-I"+config.pyqt_sip_dir,
         "-I"+config.qt_inc_dir, config.pyqt_sip_flags,
         "lib/GNUSyntaxHighlighter.sip"]
        )
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-28
      • 2021-08-09
      • 1970-01-01
      • 1970-01-01
      • 2019-02-20
      • 2015-11-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多