Re: [gtk-osx-users] ImportError: No module named gi.

On Mar 30, 2019, at 10:55 AM, Pascal <p p14 orange fr> wrote:

Le 30 mars 2019 à 03:41, John Ralls <jralls ceridwen fremont ca us> a écrit :

On Mar 29, 2019, at 2:20 PM, Pascal <p p14 orange fr> wrote:


I have install GTK+ 3 and Python with:
$ jhbuild build python

Then PyObject with:
$ jhbuild build pygobject

But I've the error: "ImportError: No module named gi"

Where is it wrong?

pygobject needs gobject-introspection. Build meta-gtk-osx-core-gtk3 instead of just gtk+-3.0.
Also you need python3 rather than python nowadays.

Hello John,

Sorry, my wording was incorrect.
$ jhbuild build pygobject
is built without any error.
But I've got "ImportError ... gi" when running my app.

Well, I built python3 and pygobject3 but I've got another error:
$ jhbuild build python3
$ jhbuild build pygobject3
*** Building pygobject3 *** [4/4]
python build
Traceback (most recent call last):
 File "", line 29, in <module>
   import pkg_resources
ImportError: No module named pkg_resources

Note that it calls python, not python3. Since you have built both (and maybe even if you hadn't) you need to 
link $PREFIX/bin/python3 to $PREFIX/bin/python, replacing the python2 link.

John Ralls

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]