I have an old program written in Python2 i need to use, but it's not getting along with Ubuntu Xenial's dependencies.
I had to manually fetch these in order to get it to run:
libwebp6_0.6.1-2ubuntu0.18.04.1_amd64.deb
libwebpdemux2_0.6.1-2ubuntu0.18.04.1_amd64.deb
libwebpmux3_0.6.1-2ubuntu0.18.04.1_amd64.deb
python-pil_5.1.0-1ubuntu0.7_amd64.deb
python-gtk2_2.24.0-5.1ubuntu2_amd64.deb
When i run it, i get this:
myprog.py:12: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
followed by
GLib.Error: ... Required gtk+ version 3.20, current version is 3.18 (7)
Using gi.require_version('Gtk', '3.20')
results in ValueError: Namespace Gtk not available for version 3.20
.
I don't think there's GTK3 for Python2 on Xenial.
The newest python-gtk2
i could find is the one installed, from Bionic. So i went and compiled pybgobject 3.20 after installing a bunch of dependencies:
export GI_LIBS="-L/usr/lib/x86_64-linux-gnu -lglib-2.0"
export GI_CFLAGS="-I/usr/include/glib-2.0 -I/usr/include/glib-2.0/include"
export PYCAIRO_CFLAGS="-I/usr/include/pycairo"
export CPPFLAGS="-I/usr/include/gobject-introspection-1.0"
./configure --prefix=${MY_BASE}/build --enable-static --enable-shared --with-python=python2
and tried to run it with LD_LIBRARY_PATH=${MY_BASE}/build python2 myprog.py
but hit the same issue. I tried variations until LD_LIBRARY_PATH=${MY_BASE}/build/lib/python2.7/site-packages
, same result.
Did i compile the wrong package? What am i missing?
These are the packages i have installed at the moment:
$ apt list --installed|grep python|grep -v python3
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
dh-python/xenial-updates,xenial-updates,xenial-security,xenial-security,now 2.20151103ubuntu1.2 all [installed]
libpython-dev/xenial-updates,now 2.7.12-1~16.04 amd64 [installed,automatic]
libpython-stdlib/xenial-updates,now 2.7.12-1~16.04 amd64 [installed]
libpython2.7/xenial-updates,xenial-security,now 2.7.12-1ubuntu0~16.04.13 amd64 [installed]
libpython2.7-dev/xenial-updates,xenial-security,now 2.7.12-1ubuntu0~16.04.13 amd64 [installed]
libpython2.7-minimal/xenial-updates,xenial-security,now 2.7.12-1ubuntu0~16.04.13 amd64 [installed]
libpython2.7-stdlib/xenial-updates,xenial-security,now 2.7.12-1ubuntu0~16.04.13 amd64 [installed]
python/xenial-updates,now 2.7.12-1~16.04 amd64 [installed]
python-apt-common/xenial-updates,xenial-updates,xenial-security,xenial-security,now 1.1.0~beta1ubuntu0.16.04.11 all [installed]
python-cairo/xenial,now 1.8.8-2 amd64 [installed,automatic]
python-cairo-dev/xenial,xenial,now 1.8.8-2 all [installed]
python-cheetah/xenial,now 2.4.4-3.fakesyncbuild1 amd64 [installed,automatic]
python-configparser/xenial,xenial,now 3.3.0r2-2 all [installed]
python-dev/xenial-updates,now 2.7.12-1~16.04 amd64 [installed]
python-dialog/xenial,now 3.3.0-2 amd64 [installed]
python-gi/xenial,now 3.20.0-0ubuntu1 amd64 [installed,automatic]
python-gi-cairo/xenial,now 3.20.0-0ubuntu1 amd64 [installed]
python-gi-dev/xenial,now 3.20.0-0ubuntu1 amd64 [installed]
python-gobject/xenial,xenial,now 3.20.0-0ubuntu1 all [installed]
python-gobject-2/xenial,now 2.28.6-12ubuntu1 amd64 [installed,automatic]
python-gobject-2-dev/xenial,xenial,now 2.28.6-12ubuntu1 all [installed]
python-gobject-dev/xenial,xenial,now 3.20.0-0ubuntu1 all [installed]
python-gtk2/now 2.24.0-5.1ubuntu2 amd64 [installed,local]
python-libvirt/xenial-updates,now 1.3.1-1ubuntu1.1 amd64 [installed,automatic]
python-mako/xenial,xenial,now 1.0.3+ds1-1ubuntu1 all [installed,automatic]
python-markupsafe/xenial,now 0.23-2build2 amd64 [installed,automatic]
python-minimal/xenial-updates,now 2.7.12-1~16.04 amd64 [installed]
python-mysqldb/xenial,now 1.3.7-1build2 amd64 [installed]
python-pil/now 5.1.0-1ubuntu0.7 amd64 [installed,local]
python-pip/xenial-updates,xenial-updates,xenial-security,xenial-security,now 8.1.1-2ubuntu0.6 all [installed]
python-pip-whl/xenial-updates,xenial-updates,xenial-security,xenial-security,now 8.1.1-2ubuntu0.6 all [installed,automatic]
python-pkg-resources/xenial,xenial,now 20.7.0-1 all [installed,automatic]
python-pygments/xenial,xenial,now 2.1+dfsg-1 all [installed,automatic]
python-sqlalchemy/xenial,xenial,now 1.0.11+ds1-1ubuntu2 all [installed]
python-talloc/xenial,now 2.1.5-2 amd64 [installed]
python-vm-builder/xenial,xenial,now 0.12.4+bzr494-0ubuntu1 all [installed,automatic]
python-yaml/xenial,now 3.11-3build1 amd64 [installed,automatic]
python2.7/xenial-updates,xenial-security,now 2.7.12-1ubuntu0~16.04.13 amd64 [installed]
python2.7-dev/xenial-updates,xenial-security,now 2.7.12-1ubuntu0~16.04.13 amd64 [installed,automatic]
python2.7-minimal/xenial-updates,xenial-security,now 2.7.12-1ubuntu0~16.04.13 amd64 [installed]
Also added these:
libglade2-0_2.6.4-2_amd64.deb
python-glade2_2.24.0-5.1ubuntu2_amd64.deb