I'm trying to use Pygame with Python 3.3 on my windows 8 laptop. Pygame installed fine and when I import pygame it imports fine as well. Although when I try to execute this small code:
import pygame
pygame.init()
size=[700,500]
screen=pygame.display.set_mode(size)
I get this error:
Traceback (most recent call last):
File "C:\Users\name\documents\python\pygame_example.py", line 3, in <module>
pygame.init()
AttributeError: 'module' object has no attribute 'init'
I used pygame-1.9.2a0-hg_56e0eadfc267.win32-py3.3 to install Pygame. Pygame is installed in this location 'C:\PythonX' and Python 3.3 is installed in this location 'C:\Python33'. I have looked at other people having the same or similar problem and it doesn't seem to solve the error. Have I done anything wrong when installing Pygame? Or does it not support windows 8?
import pygame; print(pygame.__file__)print?pygamemodule or something else. It is certainly possible that the 'real'pygamemodule has no.__file__attribute, but it is surprising. Doesprint(pygame)give any detail?print()statements to your script, not run them in a Python shell please.print(pygame.__file__)in my script I still got the same error as before and when I printedprint(game)in my script I got this:<module 'pygame' (namespace)>. @MartijnPieters