python3 pygame ImportError: No module named 'pygame.base'

python3 pygame ImportError: No module named 'pygame.base'

Postby gogua » Sun Jun 16, 2013 12:47 pm

I use a Linux opensuse and python3.3 installed pygame-1.9.1 I installed pygame How to correct an error?

Code: Select all
>>> import pygame
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import pygame
  File "/usr/lib64/python3.3/site-packages/pygame/", line 95, in <module>
    from pygame.base import *
ImportError: No module named 'pygame.base'
Last edited by Yoriz on Sun Jun 16, 2013 5:35 pm, edited 2 times in total.
Reason: Added code tags, modified title
User avatar
Posts: 1
Joined: Sun Jun 16, 2013 12:25 pm
Location: GE,Georgia

Re: python3 pygame importerror

Postby DrakeMagi » Sun Jun 16, 2013 2:42 pm

1 possibility is that python 3.3 is not the main python on opensuse.

like my debian wheezy python 2.7.3 is the main.
I can also use python 3.2 which pygame doesn't work with it.

pygame install has to match it python version to use it.
Linux: won't find windows here.
Linux: the choice of a GNU generation.
Posts: 112
Joined: Sun May 12, 2013 8:36 pm

Re: python3 pygame importerror

Postby Mekire » Sun Jun 16, 2013 2:58 pm

I know Metul had problems with this to the point he wrote a short tutorial on it. Maybe you will find some clarity there.
Pygame python3.x Installation

New Users, Read This
  • Use code tags when posting code.
  • Include any errors with your post (in code tags).
  • Describe your problem; not your chosen solution.
  • Make examples the minimum length to demonstrate your issue.
User avatar
Posts: 1711
Joined: Thu Feb 07, 2013 11:33 pm
Location: Tucson, Arizona

Re: python3 pygame ImportError: No module named 'pygame.base

Postby metulburr » Sun Jun 16, 2013 6:11 pm

i essentially abandoned pygame 1.9.1 for python3.x and use pygame 1.9.2 pre. I have had no problems with it.
Code: Select all
metulburr@ubuntu:~$ python3
Python 3.3.1 (default, Apr 17 2013, 22:30:32)
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pygame.base import *
>>> import sys
>>> sys.path
['', '/usr/lib/python3.3', '/usr/lib/python3.3/plat-x86_64-linux-gnu', '/usr/lib/python3.3/lib-dynload', '/usr/local/lib/python3.3/dist-packages', '/usr/lib/python3/dist-packages']
>>> exit()
metulburr@ubuntu:~$ cd /usr/local/lib/python3.3/dist-packages
metulburr@ubuntu:/usr/local/lib/python3.3/dist-packages$ ls
bottle-0.11.3.egg-info  pygame                     pymunkoptions               pygame-1.9.2pre.egg-info   pymysql
django                  pyglet                     PyMySQL3-0.4.egg-info
Django-1.5.1.egg-info   pyglet-1.2alpha1.egg-info  PyOpenGL-3.0.2.egg-info
OpenGL                  pymunk                     sympy
__pycache__             pymunk-3.0.0.egg-info      sympy-0.7.2.egg-info
metulburr@ubuntu:/usr/local/lib/python3.3/dist-packages$ ls | grep pygame

actually now i dont even do all that, i just use my setup script every time. Although i have only tested it on ubuntu so far. I should change it for numerous distros, as the name indicates:
we will be moving to on October 1 2016
more details here
User avatar
Posts: 2244
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Return to Game Development

Who is online

Users browsing this forum: No registered users and 3 guests