Re: [gtk-osx-users] pygobject3 installation with Python 2.





On Apr 1, 2021, at 1:00 PM, Pascal <p p14 orange fr> wrote:


Le 1 avr. 2021 à 05:18, John Ralls <jralls ceridwen us> a écrit :

On Mar 31, 2021, at 12:27 PM, Pascal <p p14 orange fr> wrote:

Hello,

I've built pygobject with the following command:
% jhbuild build pygobject3

It installs python stuff only in $prefix/lib/python3.8.

The GTK based program I'm porting to macOS uses Python 2.7 (I hope not for a very long time) and it 
issues the error:
ImportError: No module named gi

How to tell the installer to put also files in $prefix/lib/python2.7?

Note: "jhbuild build pygobject" doesn't install gi stuff.

Pascal,

Assuming that you're building both python and python3 and that you've gotten the names in $PREFIX/bin 
sorted, try passing -Dpython=python2 as an additional mesonarg to pygobject3.

Many many thanks John, this did the job :-)

However, I got:
Run-time dependency pycairo found: NO (tried pkgconfig, framework and cmake)

Thus I had to rebuild pycairo for Python 2 with the same extra option and it did the job:

% jhbuild shell
% cd pycairo-1.18.1
% mkdir build
% cd build
% meson -Dpython=python2 --prefix /opt/xnadalib-2020 --libdir lib  --wrap-mode=nofallback 
/opt/src-2020/pycairo-1.18.1
% ninja
% ninja install
% pkg-config pycairo --libs
% meson -Dpython=python2 --prefix /opt/xnadalib-2020 --libdir lib  --wrap-mode=nofallback 
/opt/src-2020/pygobject-3.32.2
% cd -
% cd pygobject-3.32.2
% cd build
% meson -Dpython=python2 --prefix /opt/xnadalib-2020 --libdir lib  --wrap-mode=nofallback 
/opt/src-2020/pygobject-3.32.2
% ninja
% ninja install

So, GNAT Studio (https://github.com/AdaCore/gps - IDE for Ada language) is running on macOS Big Sur!
Well, the mouse clic is weird: when clicking in a source code it selects many lines as shift key was 
pressed while clicking (text selection) !?

Good that it works, and maybe a little surprising. You might have to brush up on your C skills to debug the 
mouse click weirdness--but it would probably be a better use of your time to port it to python3 and gtk3.

Regards,
John Ralls



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