fpaquet / gtksheet

A spreadsheet widget for Gtk+
http://fpaquet.github.io/gtksheet/
Other
27 stars 9 forks source link

cannot import GtkSheet using GObject Introspection after install #13

Closed benreu closed 4 years ago

benreu commented 5 years ago

So I installed GtkSheet using:

meson setup --prefix=/usr .Linux.3.x86_64
ninja install -C .Linux.3.x86_64
sudo ninja install -C .Linux.3.x86_64

However when trying to import GtkSheet in Python using: from gi.repository import GtkSheet it fails with :

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/gi/importer.py", line 133, in load_module
    'introspection typelib not found' % namespace)
ImportError: cannot import name GtkSheet, introspection typelib not found

I have verified that the file /usr/lib/x86_64-linux-gnu/girepository-1.0/GtkSheet-4.3.2.typelib does exist. Any other ideas?

benreu commented 4 years ago

Ok, so I used g-ir-compiler --shared-library=gtksheet GtkSheet-4.3.2.gir -o GtkSheet-4.3.2.typelib and diff reported that the .typelib file differs, so I copied it to

'/usr/lib/x86_64-linux-gnu/girepository-1.0/GtkSheet-4.3.2.typelib'

and made sure the permissions match to the other typelib files, but still no joy.

benreu commented 4 years ago

Ok, so I finally got it: change the version in the gir file to 4.3 rename the gir file to GtkSheet-4.3.gir regenerate the gir file to the typelib file copy the gir file and the typelib file to their respective locations

I still think this is a bug that should be fixed

benreu commented 4 years ago

In other words, gi repository does not support micro versions

fpaquet commented 4 years ago

Somewhat late, but i didn't get notifications for the sheet issues.

Does this mean that i shouldn't make use of micro versions?

benreu commented 4 years ago

I am not sure how to handle micro versions while using gobject introspection. No other GI library I have seen uses micro versions, and I can't find anything online about versioning and gobject introspection.

fpaquet commented 4 years ago

Maybe i should update gobject introspection to latest. Currently i'm using pretty old v1.46.0 Available is v1.64

benreu commented 4 years ago

I am using gobject introspection 1.56.1. I don't have a lot of time lately to dig in this deeper, to see if I can find more details.

fpaquet commented 4 years ago

I'm expecting this issue to be solved by the fix of #23. The fix was pushed to branch gtk3_fixes. To be published with next release.

fpaquet commented 2 years ago

Thank you for reporting. Can you give me more information about your build environment?

danyeaw commented 2 years ago

@fpaquet I have tried with the gtk3 branch and V4.3.5. The gobject introspection version is 1.70.0.

fpaquet commented 2 years ago

Thank you, i will try out gobject introspection 1.70.0

(currently i'm using 1.46.0)