gpt4 book ai didi

python - 我必须安装什么来解决 Could not find any typelib for GtkSource, Cannot import : GtkSourceView, cannot import name GtkSource

转载 作者:太空狗 更新时间:2023-10-29 21:31:51 27 4
gpt4 key购买 nike

我正在尝试为来自 https://bugzilla.gnome.org/show_bug.cgi?id=680569 的 meld 应用补丁我自己,我遇到了这个问题:

$ git clone git://git.gnome.org/meld
$ cd meld
$ python setup.py build
$ bin/meld
2014-01-11 16:30:44,736 ERROR root: Could not find any typelib for GtkSource
Cannot import: GtkSourceView
cannot import name GtkSource

我对 Python 知之甚少,例如不知道(还)什么是 Python 的类型库 - 请赐教! ;-) 我环顾四周,模糊地认为这与一种奇异的水果有关 ;) 名为 gir,但这似乎无济于事:

$ sudo apt-get install gir1.2-gtk-3.0 
gir1.2-gtk-3.0 is already the newest version.
$ sudo apt-get install gir1.2-gtk-2.0
The following NEW packages will be installed:
gir1.2-gtk-2.0
Setting up gir1.2-gtk-2.0 (2.24.20-1ubuntu1) ...
$ bin/meld
2014-01-11 16:32:24,133 ERROR root: Could not find any typelib for GtkSource
Cannot import: GtkSourceView
cannot import name GtkSource

我错过了什么?谢谢!

最佳答案

在 Debian/Ubuntu 机器上安装你需要的库:

sudo apt-get install gir1.2-gtksource-3.0

GtkSourceView 是一个 C 库,它允许应用程序显示带有代码语法高亮显示的文本缓冲区,以及许多其他好东西。

https://wiki.gnome.org/Projects/GtkSourceView

上面的包有如下描述:

GtkSourceView is a text widget that extends the standard GTK+ 3.x text widget GtkTextView. It improves GtkTextView by implementing syntax highlighting and other features typical of a source editor. This package contains gobject introspection information.

自 Gtk+ 3.0 以来,有一个名为Introspection 的系统,它允许分析用 C 编写的源代码,以便为其他语言(如 Python、Vala 等)动态生成绑定(bind)。gir 用于 GObject Introspection Repository(我不确定 R)。引用:

https://wiki.gnome.org/action/show/Projects/GObjectIntrospection?action=show&redirect=GObjectIntrospection#What_is_introspection.3F

GObject introspection is a middleware layer between C libraries (using GObject) and language bindings. The C library can be scanned at compile time and generate a metadata file, in addition to the actual native C library. Then at runtime, language bindings can read this metadata and automatically provide bindings to call into the C library.

关于python - 我必须安装什么来解决 Could not find any typelib for GtkSource, Cannot import : GtkSourceView, cannot import name GtkSource,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21064163/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com