Re: [gtk-osx-users] bundling with python3 and pygobject



On Fri, Aug 7, 2015 at 10:18 PM, Ben Letham <bletham gmail com> wrote:
Hi,

I have an open source project that is written in Python with GTK. I am in the process of converting from Python 2.7 / PyGTK to Python 3 / GTK3 / PyGObject, due to PyGTK being deprecated and not working in OSX10.10. Everything works in linux (my comfort zone) and windows, but I'm really struggling in osx.

I followed the directions here to set up jhbuild:

I was able to install the modules given in those instructions (like meta-gtk-osx-python-gtk3).

For the bundling (https://wiki.gnome.org/Projects/GTK%2B/OSX/Bundling) my .bundle file has:

<binary dest="${bundle}/Contents/MacOS">
    ${prefix}/bin/python3
</binary>

In order to get python3 into ${prefix}/bin/python3 my understanding is that I need to run
jhbuild build python3

When I run this, the build process errors with:

DYLD_LIBRARY_PATH=/Users/stewarthamblin/gtk/source/Python-3.4.3 ./python.exe -E -S -m sysconfig --generate-posix-vars ;\
    if test $? -ne 0 ; then \
        echo "generate-posix-vars failed" ; \
        rm -f ./pybuilddir.txt ; \
        exit 1 ; \
    fi
/bin/sh: line 1:  3587 Killed: 9               DYLD_LIBRARY_PATH=/Users/stewarthamblin/gtk/source/Python-3.4.3 ./python.exe -E -S -m sysconfig --generate-posix-vars
generate-posix-vars failed
make: *** [pybuilddir.txt] Error 1
*** Error during phase build of python3: ########## Error running make -j 2 *** [3/3]


I did previously run
jhbuild build python

which installed python2.7, successfully. It created ${prefix}/bin/python2. I had thought that maybe there was some conflict in having installed this first, so I did run jhbuild uninstall python and jhbuild clean python, both of which ran without error but did not resolve the issue with installing python3.

Has anyone successfully bundled an app with Python 3 and GTK3? The examples with gtk-mac-bundler have a PyGTK example and a GTK3 example, but nothing with Python 3 and PyGObject. I'm not very familiar with Gtk or OSX, so any help would be greatly appreciated.

Thanks,
Ben

I believe got the same error building python3 on OSX 10.10 last time I tried, a few months ago. Unfortunately I did not look into it further at the time, as I was able to proceed with what I was trying to do, using a Homebrew-built Python 3.

You might be able to do the same if you carefully copy all the Python 3 files from the Homebrew cellar into your JHbuild tree.

Hope this helps,
--
Philip


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