When trying to install python-gtk2, I get the following errors:
sudo apt-get install python-gtk2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
python-gtk2 : Depends: python (< 2.8) but 3.4.3-1 is to be installed
Depends: python:any (>= 2.6.6-7~)
Depends: python-cairo (>= 1.0.2-1.1) but it is not going to be installed
Depends: python-gobject-2 (>= 2.21.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
But I have python2.7 installed. When I run python in terminal, it works properly (Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)). What should I do in this situation? Things I have tried include:
sudo apt-get -f install
sudo apt-get update –fix-missing
sudo dpkg –configure -a
After running sudo apt-cache policy python
I get this output:
sudo apt-cache policy python
python:
Installed: 3.4.3-1
Candidate: 3.4.3-1
Version table:
*** 3.4.3-1 100
100 /var/lib/dpkg/status
2.7.15~rc1-1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
python-gtk
depends onpython
being installed (version less than 2.8, but you are going to install 3.4.3-1 which is not less than 2.8). You haven't told us what Ubuntu you are using, as all supported releases of Ubuntu contain a python package that meets the first 'dep' rule (https://packages.ubuntu.com/search?keywords=python). (https://packages.ubuntu.com/bionic/python-gtk2) – guiverc Jul 26 '18 at 05:54sudo apt-cache policy python
will probably show something in your sources that will cause 3.4.3-1 listed in your error message to be loaded.. Please add the output of that command to your question. – guiverc Jul 26 '18 at 05:59apt-cache
) have created that issue. I just picked another package (https://packages.ubuntu.com/bionic/python-cairo) and it should also have been no problem; it feels like you're not running Ubuntu (or you've heavily modified it creating problems...) I'd check your sources for non-Ubuntu .. – guiverc Jul 26 '18 at 06:08