I am trying to install Pygobject on my 64-bit Ubuntu 16.04 by following instructions given here: https://python-gtk-3-tutorial.readthedocs.io/en/latest/install.html
It recommends using jhbuild
to build pygobject. So I install jhbuild
(something I've never seen before following instructions given here: https://developer.gnome.org/jhbuild/unstable/getting-started.html.en) which worked out fine.
Initially I had to run jhbuild sysdeps --install
to install missing dependencies which took a LONG time. After it was done it said Nothing to install
which I presume means it found everything it needed.
Then the
jhbuild bootstrap
command said *** success *** [1/1]
. OK.
The jhbuild sanitycheck
gives no output, (supposedly) meaning all is well.
Then, I run the command jhbuild build pygobject
and get error:
Checking if "C_IN in public headers (no arpa/nameser_compat.h needed)"
compiles: NO
Checking if "arpa/nameser_compat.h needed for C_IN" compiles: NO
gio/meson.build:35:6: ERROR: Problem encountered: Could not find
required includes for ARPA C_IN
A full log can be found at
/home/anshulvj/.cache/jhbuild/build/glib/meson-logs/meson-log.txt
*** Error during phase configure of glib: ########## Error running
meson --prefix /home/anshulvj/jhbuild/install --libdir lib -
Dlibmount=false --buildtype=debugoptimized -Dgtk_doc=false
/home/anshulvj/jhbuild/checkout/glib *** [6/10]
[1] Rerun phase configure
[2] Ignore error and continue to build
[3] Give up on module
[4] Start shell
[5] Reload configuration
[6] Go to phase "wipe directory and start over"
choice:
Doesn't matter what I choose, it either ends the build or gives errors like the following, if I choose [2]:
*** Building glib *** [6/10]
ninja
ninja: error: loading 'build.ninja': No such file or directory
*** Error during phase build of glib: ########## Error running ninja
*** [6/10]
.
.
.
and then
configure: error: Package requirements (glib-2.0 >= 2.57.1) were not met:
Requested 'glib-2.0 >= 2.57.1' but version of GLib is 2.48.2
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables GLIB_CFLAGS
and GLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
*** Error during phase configure of gobject-introspection: ########## Error running /home/anshulvj/jhbuild/checkout/gobject-introspection/autogen.sh --prefix /home/anshulvj/jhbuild/install --disable-Werror --with-python=python3 --disable-static --disable-gtk-doc *** [9/10]
Which is weird because I cannot find anything related to installing glib2.57
or greater online. (https://github.com/GNOME/glib)
The documentation at https://python-gtk-3-tutorial.readthedocs.io/en/latest/install.html does not deal with these errors and I'm completely lost. I googled a lot but did not find anyone who was facing the same issue. If this does not work I'm going to give up on Python3+GTK3+.
Any help/pointers are appreciated.
EDIT: Today I tried installing based on instructions given here https://pygobject.readthedocs.io/en/latest/getting_started.html using pip. It doesn't matter if I use pip or pip3 I get the following error.
(venv) anshulvj@anshulvj-HP-ZBook-15-G3:~/IRS2-415-Python$ pip3 install pygobject
Collecting pygobject
Using cached https://files.pythonhosted.org/packages/e0/e8/1e4f21800015a9ca153969e85fc29f7962f8f82fc5dbc1ecbdeb9dc54c75/PyGObject-3.28.3.tar.gz
Requirement already satisfied: pycairo>=1.11.1 in ./venv/lib/python3.6/site-packages (from pygobject) (1.17.1)
Installing collected packages: pygobject
Running setup.py install for pygobject ... error
Complete output from command /home/anshulvj/IRS2-415-Python/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-kikh0jeu/pygobject/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-6r4kbumk/install-record.txt --single-version-externally-managed --compile --install-headers /home/anshulvj/IRS2-415-Python/venv/include/site/python3.6/pygobject:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/pygtkcompat
copying pygtkcompat/generictreemodel.py -> build/lib.linux-x86_64-3.6/pygtkcompat
copying pygtkcompat/pygtkcompat.py -> build/lib.linux-x86_64-3.6/pygtkcompat
copying pygtkcompat/__init__.py -> build/lib.linux-x86_64-3.6/pygtkcompat
creating build/lib.linux-x86_64-3.6/gi
copying gi/_error.py -> build/lib.linux-x86_64-3.6/gi
copying gi/module.py -> build/lib.linux-x86_64-3.6/gi
copying gi/_option.py -> build/lib.linux-x86_64-3.6/gi
copying gi/types.py -> build/lib.linux-x86_64-3.6/gi
copying gi/_ossighelper.py -> build/lib.linux-x86_64-3.6/gi
copying gi/pygtkcompat.py -> build/lib.linux-x86_64-3.6/gi
copying gi/importer.py -> build/lib.linux-x86_64-3.6/gi
copying gi/_constants.py -> build/lib.linux-x86_64-3.6/gi
copying gi/__init__.py -> build/lib.linux-x86_64-3.6/gi
copying gi/docstring.py -> build/lib.linux-x86_64-3.6/gi
copying gi/_signalhelper.py -> build/lib.linux-x86_64-3.6/gi
copying gi/_propertyhelper.py -> build/lib.linux-x86_64-3.6/gi
creating build/lib.linux-x86_64-3.6/gi/repository
copying gi/repository/__init__.py -> build/lib.linux-x86_64-3.6/gi/repository
creating build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/GLib.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/GObject.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/GIMarshallingTests.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/Gio.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/Pango.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/Gtk.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/__init__.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/Gdk.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/keysyms.py -> build/lib.linux-x86_64-3.6/gi/overrides
running build_ext
pycairo: new API
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 840, in <module>
main()
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 835, in main
zip_safe=False,
File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/anshulvj/IRS2-415-Python/venv/lib/python3.6/site-packages/setuptools-28.8.0-py3.6.egg/setuptools/command/install.py", line 61, in run
File "/usr/lib/python3.6/distutils/command/install.py", line 589, in run
self.run_command('build')
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 684, in run
self._setup_extensions()
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 680, in _setup_extensions
add_pycairo(gi_cairo_ext)
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 665, in add_pycairo
ext.include_dirs += [get_pycairo_include_dir()]
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 582, in get_pycairo_include_dir
include_dir = find_path(find_new_api())
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 532, in find_new_api
import cairo
File "/home/anshulvj/IRS2-415-Python/venv/lib/python3.6/site-packages/cairo/__init__.py", line 1, in <module>
from ._cairo import * # noqa: F401,F403
ImportError: /home/anshulvj/IRS2-415-Python/venv/lib/python3.6/site-packages/cairo/_cairo.cpython-36m-x86_64-linux-gnu.so: undefined symbol: cairo_tee_surface_index
----------------------------------------
Command "/home/anshulvj/IRS2-415-Python/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-kikh0jeu/pygobject/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-6r4kbumk/install-record.txt --single-version-externally-managed --compile --install-headers /home/anshulvj/IRS2-415-Python/venv/include/site/python3.6/pygobject" failed with error code 1 in /tmp/pip-install-kikh0jeu/pygobject/
Could not find much about
ImportError: /home/anshulvj/IRS2-415-Python/venv/lib/python3.6/site-packages/cairo/_cairo.cpython-36m-x86_64-linux-gnu.so: undefined symbol: cairo_tee_surface_index
online. Any help is appreciated.