Python Forum

Full Version: IDLE not importing pygame (ok outside of IDLE)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I do have pygame installed on my ubuntu 16.04 system. I know this because when I run the program outside of IDLE (or IDLE3) I get
the following from a .py file with nothing but "import pygame" in it.

"pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html"

However, when I run the same file from a shell invoked from within IDLE I get

"Traceback (most recent call last):
File "/home/tom/Downloads/projects/ZenvaCourse/Variables_Text.py", line 1, in <module>
import pygame
File "/usr/local/lib/python3.6/dist-packages/pygame/__init__.py", line 136, in <module>
from pygame.base import *
ImportError: No module named base"


I have not found a solution so far.

Thank You
Tom
simple answer. Don't use IDLE. It;s not a good IDE (if you can call it that), and I don't know why python.org keeps including it as part of the package. You should consider:
my choices in order:
VSCode: (Not to be confused with Visual Studio)
or PyCharm:
or perhaps another: