51

我正在尝试让 pygobject-2.28.6 在 cygwin 中编译(存储库中的版本是 2.28.4,它有一些问题)。这是 ./configure 的尾部:

checking for GLIB - version >= 2.24.0... yes (version 2.34.3)
checking for ffi... checking for FFI... yes
checking for GIO... yes
checking for GIOUNIX... yes
checking for GI... no
configure: error: Package requirements (glib-2.0 >= 2.24.0
        gobject-introspection-1.0 >= 0.10.2
    ) were not met:

No package 'gobject-introspection-1.0' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GI_CFLAGS
and GI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

我安装了 gobject-introspection 1.34.2-3。如此处所示:

$ whereis gobject-introspection
gobject-introspection: /lib/gobject-introspection /usr/lib/gobject-introspection

和这里

$ whereis gobject-introspection-1.0
gobject-introspection-1: /usr/share/gobject-introspection-1.0

我尝试在 configure = 中将 GI_CFLAGS 和 GI_LIBS 设置为 /lib/ 和 /usr/lib/(甚至 /usr/share/),但无济于事。我还能做些什么来尝试解决这个问题?感谢您的时间!

4

4 回答 4

80

您可能缺少开发包。软件包名称因发行版而异,但它包含/usr/lib/pkgconfig/gobject-introspection-1.0.pc(或/usr/lib64/pkgconfig/gobject-introspection-1.0.pc某些 64 位发行版):

  • Fedora、CentOS、RHELgobject-introspection-devel
  • Debian、Ubuntu、Mintlibgirepository1.0-dev
  • Arch:gobject-introspection
  • FreeBSD:gobject-introspection
  • Cygwin:libgirepository1.0-devel
  • msys2:mingw-w64-x86_64-gobject-introspection和/或mingw-w64-i686-gobject-introspection
于 2013-08-02T22:58:52.130 回答
18

我得到这个在cygwin上编译。你需要的包是:libgirepository1.0-devel.

在 Ubuntu 中,它被称为libgirepository1.0-dev

于 2014-01-16T12:19:20.137 回答
3

我没有足够的代表发表评论,所以这实际上是对 nemequ 答案的补充:

  • MSYS2:mingw-w64-x86_64-gobject-introspection和/或mingw-w64-i686-gobject-introspection
于 2016-12-08T18:45:33.347 回答
1

对于 macOS {mine is(intel cpu)}:

 brew install pygobject3 gtk+3
 pip install --no-use-pep517 PyGObject

它在 python 2.7 虚拟环境中工作。

于 2021-07-22T08:18:30.730 回答