Ubuntu 20.04 ImportError: No module named gtk.glade
The python-gtk2
with python-glade2
may be installed manually using packages from 18.04 LTS by the commands below:
cd ~/Downloads
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/p/pygtk/python-gtk2_2.24.0-5.1ubuntu2_amd64.deb
sudo apt-get install ./python-gtk2_2.24.0-5.1ubuntu2_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/p/pygtk/python-glade2_2.24.0-5.1ubuntu2_amd64.deb
sudo apt-get install ./python-glade2_2.24.0-5.1ubuntu2_amd64.deb
Kyeiv
Updated on September 18, 2022Comments
-
Kyeiv over 1 year
i am trying to launch an old python2 script. On ubuntu 18.04 i installed python-glade2 and it worked, unfortunately ubuntu 20.04 doesn't have it in repositories. Is there a way to get this gtk.glade module? Maybe some other library that provides it?
@edit: after following N0rbert's suggestions gtk/glade are installed but, unfortunately I also need python-gdal which I was trying to install in a similiar way and got error:
The following packages have unmet dependencies. python-gdal : Depends: gdal-abi-2-2-3 but it is not installable Depends: libgdal20 (>= 2.2.2) but it is not installable E: Unable to correct problems, you have held broken packages.
I assume that some packages from Ubuntu 20 that i need conflicts with the ones from ubuntu 18.
output of
apt-cache policy python-gdal libgdal20
:python-gdal: Installed: (none) Candidate: (none) Version table: libgdal20: Installed: (none) Candidate: (none) Version table:
I am wondering if downloading .debs from ubuntu 18, then extracting only .py files and copying them into script directory is an only option here –
-
N0rbert over 3 yearsTry to run
sudo apt-get dist-upgrade
to get newest dependencies for current Ubuntu version. -
Kyeiv over 3 yearsit doesn't change apt-cache policy output. I think it's because python2 bindings are obsolete so the dependency libs were withdrawn
-
N0rbert over 3 yearsDo you have Gtk part solved? Can you
import gtk.glade
usingpython2
? -
Kyeiv over 3 yearsyes, I no longer get the
No module named gtk.glade
error. -
N0rbert over 3 yearsSo lets mark this problem solved (accept below answer). And then ask new question about Gdal.
-
Kyeiv over 3 yearsproblem from the topic is solved, for the new one I created this thread
-
-
Kyeiv over 3 yearsthank you N0rbert, unfortunately I also need python-gdal which I was trying to install in a similiar way you suggested and got error:
The following packages have unmet dependencies. python-gdal : Depends: gdal-abi-2-2-3 but it is not installable Depends: libgdal20 (>= 2.2.2) but it is not installable E: Unable to correct problems, you have held broken packages.
I assume that some packages from Ubuntu 20 that i need conflicts with the ones from ubuntu 18 -
N0rbert over 3 yearsSeems to be unrelated to Gtk issue. But anyway please add output of
apt-cache policy python-gdal libgdal20
to the question. -
Kyeiv over 3 years
python-gdal: Installed: (none) Candidate: (none) Version table: libgdal20: Installed: (none) Candidate: (none) Version table:
I am wondering if downloading .debs from ubuntu 18, then extracting only .py files and copying them into script directory is an only option here -
N0rbert over 3 yearsPlease add such information to question body by editing it. In comments they are hard to read.
-
Kyeiv over 3 yearsI have editted the question describing steps done by me