我试图让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 …Run Code Online (Sandbox Code Playgroud) 我正在打包一个python应用程序,它依赖于几个C库通过gobject内省.我想确保至少安装了glib中的python模块(即gi模块,在Debian中打包为python-gi,我不是在讨论不推荐使用的PyGObject模块).将其添加为常规依赖项会导致安装失败,因为它不在Pypi中.
我应该怎么声明这个?我看了一个setuptool doc,但我看不到任何诀窍.
谢谢.
相关问题:
我正在尝试使用GObject Introspection和Moo在Perl中创建一个Gtk3应用程序.有一个来自Gtk的非Moo类Gtk::ApplicationWindow,我通过Moo使用它进行子类化extends 'Gtk::ApplicationWindow'.问题是,当创建该子类的对象时,它仍然是父类的类型 - 即Gtk::ApplicationWindow.
我通过继承自己的非基于Moo的类来尝试相同的事情,并且从这个子类创建的对象具有正确的类型.造成这种差异的原因是什么?
use v5.10;
use strict;
use warnings;
# Import the Gtk classes (non-Moo)
use Glib::Object::Introspection;
Glib::Object::Introspection->setup(basename => 'Gtk', version => '3.0', package => 'Gtk');
Glib::Object::Introspection->setup(basename => 'Gio', version => '2.0', package => 'Gio');
#################################################
{
# A dummy non-Moo class
package ClassNonMoo;
sub new { bless {}, shift; }
}
{
# Moo class extending the dummy class
package ClassMoo;
use Moo;
extends 'ClassNonMoo';
sub …Run Code Online (Sandbox Code Playgroud) 首先是代码:
from gi.repository import Gtk, GtkSource, GObject
import os.path
import shelve
class MusicCollection(object):
def __init__(self):
self.builder = Gtk.Builder()
self.glade_file = 'music.glade'
GObject.type_register(GtkSource.View)
self.builder.add_from_file(self.glade_file)
self.window = self.builder.get_object("window1")
self.entry_author = self.builder.get_object("entry_author")
self.entry_album = self.builder.get_object("entry_album")
self.entry_songs = self.builder.get_object("entry_songs")
self.borrowed_toggle = self.builder.get_object("borrowed")
self.create_button = self.builder.get_object("create")
self.update_button = self.builder.get_object("update")
self.delete_button = self.builder.get_object("destroy")
self.view = self.builder.get_object("treeview1")
self.albums_list = self.builder.get_object("albums_list")
self.db = shelve.open("data.db")
self.columns = ["Author", "Album", "Songs", "Borrowed"]
self.connect_signals()
self.initialize()
self.window.show_all()
def connect_signals(self):
self.create_button.connect("clicked", self.create)
self.update_button.connect("clicked", self.update)
self.delete_button.connect("clicked", self.destroy)
self.window.connect("destroy", self.quit)
self.view.get_selection().connect("changed", self.changed)
def initialize(self):
try: …Run Code Online (Sandbox Code Playgroud) 在我得到的开源项目的"./configure"中:
user agent OS = Linux
./configure: line 13957: syntax error near unexpected token 0.9.3'
./configure: line 13957: GOBJECT_INTROSPECTION_CHECK(0.9.3)'
make: *** [config.status] Error 2
Run Code Online (Sandbox Code Playgroud)
Ubuntu 12.04软件包"gobject-introspection"和"libgirepository1.0-dev"存在.删除GOBJECT_INTROSPECTION_CHECK行允许configure完成,但项目稍后会失败.
如何干净地完成此配置步骤?谷歌搜索此问题显示针对同一阻塞问题针对众多操作系统项目提出的错误,但通常的答案是"安装gobject-introspection".
我目前正在尝试让一个简单的 GstRtspServer 程序在外部 amazon linux EC2 服务器上工作,但我在让它实际运行时遇到了严重的问题。无论我做什么,当我尝试运行它时,我总是遇到同样的错误,即使程序仅减少到
import gi
gi.require_version('Gst','1.0')
from gi.repository import GLib, Gst, GstRtspServer
Run Code Online (Sandbox Code Playgroud)
我安装了 pygobject,安装了 gstreamer,安装了 gobject-introspection,任何谷歌搜索结果都毫无帮助。有谁知道我可能会错过什么?
我正在尝试在我的 Ubuntu 14.04 上安装 totem-pl-parser-3.10.7,在autogen.sh+configure成功结束后,我使用make. 但我收到以下错误:
Couldn't find include 'GObject-2.0.gir' (search path: ['.', '.', '/usr/share/gnome-fallback/gir-1.0', '/usr/share/gnome/gir-1.0', '/usr/local/share/gir-1.0', '/usr/share/gir-1.0', '/usr/share/gir-1.0', '/usr/share/gir-1.0', '/usr/share/gir-1.0'])
Run Code Online (Sandbox Code Playgroud)
在谷歌上搜索可能的原因,发现gobject-introspection是在 之后安装了软件包libglib-2.0-dev,因此.gir无法正确找到存储库。
另外,我删除了libglib-2.0-dev( apt remove --purge) 并重新安装了它,但错误仍然相同。
有什么建议吗?
我正在尝试使用适用于 Linux 的 GeoClue 和 Python 接口(gir1.2-geoclue-2.0包)获取位置(纬度/经度)。c的文档几乎与此处的 api 函数匹配,但我不确定我应该发送什么“桌面 ID”...任何.desktop应用程序请求的有效文件?完整路径或唯一名称?
>>> Geoclue.Simple.new.__doc__
'new(desktop_id:str, accuracy_level:Geoclue.AccuracyLevel, cancellable:Gio.Cancellable=None, callback:Gio.AsyncReadyCallback=None, user_data=None)'
>>> Geoclue.Simple.new_sync('hi',Geoclue.AccuracyLevel.NEIGHBORHOOD,None)
(process:7691): Geoclue-WARNING **: Error setting property 'DesktopId' on interface org.freedesktop.GeoClue2.Client: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface 'org.freedesktop.DBus.Properties' on object at path /org/freedesktop/GeoClue2/Client/2 (g-dbus-error-quark, 19)
(process:7691): Geoclue-WARNING **: Error setting property 'RequestedAccuracyLevel' on interface org.freedesktop.GeoClue2.Client: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface 'org.freedesktop.DBus.Properties' on object at path /org/freedesktop/GeoClue2/Client/2 (g-dbus-error-quark, 19)
__main__:1: Warning: g_object_unref: assertion 'object->ref_count > 0' failed
<Geoclue.Simple …Run Code Online (Sandbox Code Playgroud) python geolocation freedesktop.org gobject-introspection geoclue
我在树莓派上构建了gstreamer最新版本。我想拥有python绑定,因此在编译gstreamer及其插件之前先安装了gobject-introspection-1.0和pygobject-3.18.2。
在gstreamer及其所有插件的构建结束时,我看到了以下文件:
pi@raspberrypi:~/kurento $ ls -ltr /usr/local/lib/girepository-1.0
total 580
-rw-r--r-- 1 root staff 214076 Mar 28 19:28 Gst-1.5.typelib
-rw-r--r-- 1 root staff 43712 Mar 28 19:28 GstBase-1.5.typelib
-rw-r--r-- 1 root staff 6500 Mar 28 19:28 GstController-1.5.typelib
-rw-r--r-- 1 root staff 6272 Mar 28 19:28 GstNet-1.5.typelib
-rw-r--r-- 1 root staff 13116 Mar 28 19:29 GstCheck-1.5.typelib
-rw-r--r-- 1 root staff 14460 Mar 28 20:23 GstTag-1.5.typelib
-rw-r--r-- 1 root staff 2508 Mar 28 20:23 GstFft-1.5.typelib
-rw-r--r-- 1 root staff 27460 Mar 28 20:23 …Run Code Online (Sandbox Code Playgroud) gstreamer pygobject python-gstreamer gobject-introspection kurento
我想将一个Gtk.Entry(已Gtk.EntryCompletion连接)打包到Gtk.TreeView. 有谁知道如何做到这一点?(我只需要对表格视图中的文本条目进行输入完成。)
Do I perhaps need to subclass Gtk.CellRenderer or Gtk.CellRendererText, and override the start_editing method (or similar)? I can find examples of subclassing Gtk.CellRenderer, but not modifying the editable behaviour. I can't find the source-code for the Gtk.CellRendererText class, either.
I'm using Gobject Introspection (i.e. from gi.repository import Gio, Gtk, GLib, Gdk).
python ×5
gobject ×3
pygobject ×3
gstreamer ×2
amazon-ec2 ×1
cygwin ×1
geoclue ×1
geolocation ×1
glib ×1
gnu-make ×1
gtk ×1
gtk3 ×1
kurento ×1
moo ×1
perl ×1
pkg-config ×1
python-3.x ×1
setuptools ×1
ubuntu ×1