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/__init__.py", 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
gogua
 
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.
https://github.com/DrakeMagi
DrakeMagi
 
Posts: 109
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

-Mek
User avatar
Mekire
 
Posts: 987
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

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
bottle.py               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
pygame
pygame-1.9.2pre.egg-info
metulburr@ubuntu:/usr/local/lib/python3.3/dist-packages$


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:
https://github.com/metulburr/distro_setup
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1455
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 2 guests