Cannot import pygame


I have installed pygame.
But when i import into the game and run python, i got an error that says import error: no module name pygame.

Anyone can help, please?

What platform are you on? Did you install a separate version of Python besides the one that Panda ships with?

If so, make sure you install pygame into the correct location, in the install process.

I am installing on windows.
I only have python that panda3D provides.
Do you mean i need to install the pygame into C:\Panda3D-1.6.0\python?

Please advise. Thanks

Pygame has to be installed into the Python copy that is going to use it. If you want to use Python version bundled with Panda, pygame has to be installed into that copy (i.e. C:\Panda3D-1.6.0\python).

If you follow this install chain:

  1. Panda3D
  2. Python
  3. whatever python add-on library

you should not have any issues on windows with automated installers.
try a fresh start uninstalling and then reinstall the packages in the correct order


I installed pygame in to the python folder and everything works now.