简体   繁体   English

我有什么安装来解决无法找到GtkSource的任何类型库,无法导入:GtkSourceView,无法导入名称GtkSource

[英]What do I have to install to resolve Could not find any typelib for GtkSource, Cannot import: GtkSourceView, cannot import name GtkSource

I'm trying to apply a patch for meld from https://bugzilla.gnome.org/show_bug.cgi?id=680569 myself, and am having trouble with this: 我正在尝试从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

I know little about Python, and eg do not know (yet) what a typelib for Python is - enlighten me! 我对Python知之甚少,例如,不知道(还有)Python的类型库是什么 - 启发我! ;-) I've looked around, and vaguely figured that this has something to do with an exotic fruit ;) named gir, but this doesn't seem to help: ;-)我环顾四周,模糊地认为这与异国情调的水果有关;)名为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

What am I missing? 我错过了什么? Thank you! 谢谢!

To install the library you need, on a Debian/Ubuntu machine: 要在Debian / Ubuntu机器上安装所需的库:

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

GtkSourceView is a C library that allows applications to display a text buffer with syntax highlight for code, and a bunch of other goodies. GtkSourceView是一个C库,它允许应用程序显示一个文本缓冲区,其中包含代码的语法高亮显示,以及一系列其他好东西。

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

The above package has the following description: 以上包装有以下描述:

GtkSourceView is a text widget that extends the standard GTK+ 3.x text widget GtkTextView. GtkSourceView是一个文本小部件,它扩展了标准的GTK + 3.x文本小部件GtkTextView。 It improves GtkTextView by implementing syntax highlighting and other features typical of a source editor. 它通过实现语法突出显示和源编辑器的其他典型功能来改进GtkTextView。 This package contains gobject introspection information. 该软件包包含gobject内省信息。

Since Gtk+ 3.0 there is a system called Introspection that allows source code written in C to be analysed in order to dynamically generate bindings for other languages, like Python, Vala, etc. gir is for GObject Introspection Repository (I'm not sure about the R ). 从Gtk + 3.0开始,有一个名为Introspection的系统允许分析用C编写的源代码,以动态生成其他语言的绑定,如Python,Vala等.gir用于GObject Introspection Repository(我不确定R )。 Citing: 举例:

https://wiki.gnome.org/action/show/Projects/GObjectIntrospection?action=show&redirect=GObjectIntrospection#What_is_introspection.3F 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. GObject内省是C库(使用GObject)和语言绑定之间的中间件层。 The C library can be scanned at compile time and generate a metadata file, in addition to the actual native C library. 除了实际的本机C库之外,还可以在编译时扫描C库并生成元数据文件。 Then at runtime, language bindings can read this metadata and automatically provide bindings to call into the C library. 然后在运行时,语言绑定可以读取此元数据并自动提供绑定以调用C库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ImportError:无法导入名称GstRtspServer,找不到内省类型库 - ImportError: cannot import name GstRtspServer, introspection typelib not found 无法使用 pip 安装任何包 我收到此错误 ImportError: cannot import name 'appdirs' - Cannot install any packages with pip I got this error ImportError: cannot import name 'appdirs' 对于“ImportError:无法导入名称 X”或“AttributeError:...(很可能是由于循环导入)”我能做些什么? - What can I do about "ImportError: Cannot import name X" or "AttributeError: ... (most likely due to a circular import)"? 我无法解决此错误:无法从“PIL”导入名称“_imaging” - I cant resolve this error: cannot import name '_imaging' from 'PIL' 如何解决错误无法导入名称样式? - How can i resolve error cannot import name style? GtkSource模块不在Python中导入 - GtkSource module not importing in Python “导入错误:无法导入名称”与全新的 Anaconda 安装 - "ImportError: cannot import name" with fresh Anaconda install 无法导入名称 find_packages? - Cannot import name find_packages? 为什么我不断收到“ ImportError:无法导入名称数据库”? - Why do I keep getting 'ImportError: cannot import name db'? 尝试在继承的类中导入基类时,为什么会出现导入错误(无法导入名称)? - Why do I get an Import Error( cannot import name) when trying to import the base class in the inherited class?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM