问题
I am trying to install pygame on an Ubuntu 16.04 system. My default python is 2.7.12. I opened terminal and tried:
sudo apt-get install python-pygame
I got this message:
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-pygame : Depends: python-numpy (>= 1:1.8.0) but it is not going to be installed
Depends: python-numpy-abi9
E: Unable to correct problems, you have held broken packages.
I then tried to install numpy and got the same message except:
The following packages have unmet dependencies:
python-numpy : Depends: python:any (>= 2.7.5-5~)
What should I do?
回答1:
Figured it out. Found a terminal command to reinstall python:
sudo apt-get purge python && sudo apt-get install python2.7
回答2:
sudo apt-get install -f
it fixes the broken dependencies
来源:https://stackoverflow.com/questions/39736745/installing-pygame-on-ubuntu