Reputation: 1
Traceback (most recent call last):
File "alien_invasion.py", line 3, in <module>
import pygame
ImportError: No module named pygame
Console says there is no module named pygame, but I've downloaded pygame already and IDLE allows me to import pygame and use it.
Upvotes: 0
Views: 959
Reputation: 1508
In the console you can use the command python --version
to see the default version of Python you are running. Most likely what is happening is you have a different version of Python running in the console than you do in IDLE. You can specify when you run it.
Try each of these in the console:
python2 alien_invasion.py
or
python3 alien_invasion.py
Upvotes: 1