pygtk not available on Focal Fossa (20.04)?
You can install python-gtk2
manually from 18.04 LTS repository:
cd ~/Downloads
wget 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
and use it as usual :)
Related videos on Youtube
Comments
-
Alfe over 1 year
tl;dr I cannot install
pygtk
on Focal Fossa (Ubuntu 20.04) anymore but need it for my self-written PyGTK-based Python application.I wrote a Python2 application some years ago based on GTK using the
pygtk
package. This worked fine for years now, I could always use the available Python2 installations, even when Python3 was the more modern variant.With Focal Fossa (Ubuntu 20.04) Python2 support has been dropped, so I thought, no problem, I can upgrade my application to Python3. After doing it, I tried to install
pygtk
for Python3 usingsudo pip3 install pygtk
but this failed:$ sudo pip3 install pygtk Collecting pygtk Using cached pygtk-2.24.0.tar.bz2 (2.4 MB) ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nezwkvr_/pygtk/setup.py'"'"'; __file__='"'"'/tmp/pip-install-nezwkvr_/pygtk/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-nezwkvr_/pygtk/pip-egg-info cwd: /tmp/pip-install-nezwkvr_/pygtk/ Complete output (4 lines): ******************************************************************** * Building PyGTK using distutils is only supported on windows. * * To build PyGTK in a supported way, read the INSTALL file. * ******************************************************************** ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
(The mentioned
pygtk-2.24.0.tar.bz2
file wasn't to be found anymore, so I could not even look at theINSTALL
file as suggested.)I also found no package for
apt install ...
that would have installed it.Alright, I thought, back to Python2. But unfortunately I cannot install
pygtk
for Python2 as well. I can install apython2
package, but there is nopip
command and/or module anymore for Python2. (So neitherpip ...
norpip2 ...
norpython2 -m pip
work. Maybe I just didn't find the correct way to do it.)So I also could not install the Python2 version.
Then I briefly tried looking up how to install a non-packaged version of pygtk but that quickly dove even deeper into more dependencies (
jhinstall
, etc.) which seemed like taking even more time, and I'm lacking the experience in solving all these.So I guessed maybe there is an easier solution and maybe someone here knows how to easily solve this issue. If nothing here pops up I will have to invest the time and solve the dependencies the hard way.
-
user535733 almost 4 yearsDoes this answer your question? Why can't I import "pygtk" with Python 3.2 from PyDev?. You likely have the
python3-gi
deb package installed already -- you don't need to install it through pip. -
Alfe almost 4 yearsIndeed this seems to be a solution! So
pygtk
is discontinued in favor of a different framework API. Unfortunately this seems to mean I will have to modify larger parts of my code. It's not as simple as ased 's/import gtk/from gi.repository import Gtk as gtk/g'
.
-
-
Alfe almost 4 yearsI will consider using it but I prefer using official packages from official sources.
-
aap almost 4 yearsI came here looking for a trick for "diffuse" and I see your PPA has it. Maybe I should just use meld, but diffuse is what I'm used to. Thanks!
-
furas over 3 yearsnice work. It works also for
Linux Mint 20
which is based onUbuntu 20.04