I am running in ubuntu and I can code in python, without problem. I have tried to install pygame and to do make it so, I did:
sudo apt-get instal python-pygame
When I go into the python IDLE and write:
import pygame
I get:
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named pygame
What can I do to solve this problem? I am forgetting something, or doing something wrong?
apt-get will install pygame for the registered and pygame-package-supported Python versions. Execute
to find out which. On my old debian system, that prints
That means if I’m not using either Python 2.4 or Python 2.5, pygame will not be available. The Python version your IDLE is using should be displayed at the top (you can also see it with
import sys; print(sys.version)).You can either manually install pygame or try to add the installed version with
Depending on the complexity of the loaded module(pygame in your case), this might cause some problems later though.