Giter Club home page Giter Club logo

Comments (3)

LiuLang avatar LiuLang commented on July 22, 2024

bcloud 只需要Python3和gtk3, 从来都不需要gtk2的任何组件的.
而且, 依赖关系也都在deb包里面写明了的. 它依赖python3-gi, 而这个python3-gi包会自动依赖相应的gtk3组件, dpkg包管理系统会自动处理这些依赖关系.

我估计是你的python3-gi 包的依赖有些问题.

from bcloud.

vincentor avatar vincentor commented on July 22, 2024

那能不能麻烦你给一下你那边的python3-gi这个包的详细信息呢?我这边是这样的:

root@hopeworld:~# dpkg -p python3-gi
Package: python3-gi
Priority: optional
Section: python
Installed-Size: 784
Maintainer: Josselin Mouette <[email protected]>
Architecture: amd64
Source: pygobject
Version: 3.2.2-2
Replaces: python3-gobject
Provides: python3-gobject
Depends: python3 (>= 3.2.3-3~), python3 (<< 3.3), libc6 (>= 2.2.5), libffi5 (>= 3.0.4), libgirepository-1.0-1 (>= 1.29.0), libglib2.0-0 (>= 2.31.8), gir1.2-glib-2.0 (>= 1.31.0)
Conflicts: python3-gobject
Size: 354096
Description: Python 3 bindings for gobject-introspection libraries
 GObject is an abstraction layer that allows programming with an object
 paradigm that is compatible with many languages. It is a part of Glib,
 the core library used to build GTK+ and GNOME.
 .
 This package contains the Python 3 binding generator for libraries that
 support gobject-introspection, i. e. which ship a gir1.2-<name>-<version>
 package. With these packages, the libraries can be used from Python 3.

from bcloud.

LiuLang avatar LiuLang commented on July 22, 2024

包信息都差不多, 只是你的太旧了, 我的对应的是gtk3.12:

~ # dpkg -p python3-gi
Package: python3-gi
Priority: optional
Section: python
Installed-Size: 872
Maintainer: Josselin Mouette <[email protected]>
Architecture: amd64
Source: pygobject (3.12.1-1)
Version: 3.12.1-1+b1
Replaces: python3-gobject
Provides: python3-gobject
Depends: python3 (<< 3.5), python3 (>= 3.4~), libc6 (>= 2.14), libgirepository-1.0-1 (>= 1.33.10), libglib2.0-0 (>= 2.38.0), gir1.2-glib-2.0 (>= 1.35.9)
Conflicts: python3-gobject
Size: 438066
Description: Python 3 bindings for gobject-introspection libraries
 GObject is an abstraction layer that allows programming with an object
 paradigm that is compatible with many languages. It is a part of Glib,
 the core library used to build GTK+ and GNOME.
 .
 This package contains the Python 3 binding generator for libraries that
 support gobject-introspection, i. e. which ship a gir1.2-<name>-<version>
 package. With these packages, the libraries can be used from Python 3.
Homepage: https://wiki.gnome.org/PyGObject

你之前贴出来的出错信息, 里面有说明:

  File "/usr/lib/python3/dist-packages/gi/module.py", line 90, in __init__
    repository.require(namespace, version)
gi.RepositoryError: Requiring namespace 'Gtk' version '2.0', but '3.0' is already loaded

是说你的/usr/lib/python3/dist-packages/gi/module.py 里面声明了要求gtk2.0, 而不是gtk3.0, 这个应该是错误的.

你可以测试一下:

~ $ cat test.py 
#!/usr/bin/env python3

from gi.repository import Gtk

class App(Gtk.Window):

    def __init__(self):
        super().__init__()
        self.connect('delete-event', self.on_quit)
        self.set_title('Hello, Gtk3')

    def run(self):
        self.show_all()
        Gtk.main()

    def on_quit(self, *args):
        Gtk.main_quit()


if __name__ == '__main__':
    app = App()
    app.run()

把这个python脚本保存一下, 在终端运行它, 看能不能显示出窗口.

from bcloud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.