3

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 –

Kyeiv
  • 55
  • 1
  • 6
  • Try to run `sudo apt-get dist-upgrade` to get newest dependencies for current Ubuntu version. – N0rbert Jul 29 '20 at 07:03
  • it doesn't change apt-cache policy output. I think it's because python2 bindings are obsolete so the dependency libs were withdrawn – Kyeiv Jul 29 '20 at 07:07
  • Do you have Gtk part solved? Can you `import gtk.glade` using `python2` ? – N0rbert Jul 29 '20 at 07:09
  • yes, I no longer get the `No module named gtk.glade` error. – Kyeiv Jul 29 '20 at 07:11
  • So lets mark this problem solved (accept below answer). And then ask new question about Gdal. – N0rbert Jul 29 '20 at 07:12
  • problem from the topic is solved, for the new one I created [this thread](https://askubuntu.com/questions/1262894/ubuntu-20-04-importerror-no-module-named-gdal) – Kyeiv Jul 29 '20 at 07:23

1 Answers1

3

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
N0rbert
  • 97,162
  • 34
  • 239
  • 423
  • thank 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 – Kyeiv Jul 29 '20 at 05:41
  • Seems to be unrelated to Gtk issue. But anyway please add output of `apt-cache policy python-gdal libgdal20` to the question. – N0rbert Jul 29 '20 at 06:52
  • `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 – Kyeiv Jul 29 '20 at 06:53
  • Please add such information to question body by [editing it](https://askubuntu.com/posts/1262685/edit). In comments they are hard to read. – N0rbert Jul 29 '20 at 06:54
  • I have editted the question describing steps done by me – Kyeiv Jul 29 '20 at 07:02