简体   繁体   中英

Installing Python GTK+ on macOS Monterey 12.4 - Module Not Found

I am trying to build a GTK application in MacOS (Monterey, v. 12.4) that includes both C GTK components and Python GTK components. I am following the instructions from both here and here . I had minimal issues with the first part (although for some reason I got an error where jhbuild said cargo did not exist when building librsvg during the call to jhbuild build meta-gtk-osx-gtk3 , despite .new_local/bin being at the front of PATH). The instructions there were simply:

sh gtk-osx-setup.sh
alias jhbuild="PATH=.new_local/bin:$PATH jhbuild"
jhbuild bootstrap-gtk-osx
jhbuild build meta-gtk-osx-bootstrap meta-gtk-osx-gtk3

In any case, the issue that I am having now is installing either set of bindings for Python. When I attempt to build either, jhbuild states both:

jhbuild@Cytocyberneticss-Mac-mini ~ % jhbuild build meta-gtk-osx-python-gtk3
Loading .env environment variables...
jhbuild build: A module called ''meta-gtk-osx-python-gtk3'' could not be found.

Usage: run_jhbuild.py [ -f config ] command [ options ... ]

jhbuild@Cytocyberneticss-Mac-mini ~ % jhbuild build meta-gtk-osx-python                             
Loading .env environment variables...
jhbuild build: A module called ''meta-gtk-osx-python'' could not be found.

Usage: run_jhbuild.py [ -f config ] command [ options ... ]

I do not have home-brew or MacPorts installed so neither of those could be getting in the way. I really am at a loss as to what the problems is here, when the other builds went fine. Any pointers would be greatly appreciated. Let me know if you need any more information about my setup.

As per the package maintainer:

I need to rewrite that Python wiki page, it's thoroughly out of date. meta-gtk-osx-python-gtk3 got changed to meta-gtk-osx-python2-gtk3, and current versions of gtk-osx don't support gtk2. What's more, python2 is obsolete and its use is deprecated; you should use meta-gtk-osx-python3-gtk3. I haven't yet made a meta-gtk-osx-python3-gtk4 but you can easily do so in your own moduleset if your application is ready for it.

So simply use either:

jhbuild build meta-gtk-osx-python3-gtk3
jhbuild build meta-gtk-osx-python2-gtk3

This question will be irrelevant though as soon as the Wiki is updated...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM