Josh
Josh

Reputation: 11

Pygame.error: file is not a WINDOWS BMP file (mac osx)

Hi after much research I cant find the answer.

running mac osx 10.8.4 python 2.7.5 and pygame 1.9.2.

all modules were found in the build of pygame and reinstalling doesnt fix the issue while running:

import pygame
import math
import random

black = (0,0,0)
red = (255,0,0)
white = (255,255,255)
blue = (0,0,255)
green = (0,255,0)

pygame.init()

print pygame.image.get_extended()
size = (1000,700)
screen = pygame.display .set_mode(size)

pygame.display.set_caption("My game")

done = False

clock = pygame.time.Clock()

background_image = pygame.image.load("red_x.png").convert()

while done == False:
     # ALL EVENT PROCESSING SHOULD GO BELOW THIS COMMENT
    for event in pygame.event.get():
        if event.type == pygame.QUIT: 
            done = True


    # ALL EVENT PROCESSING SHOULD GO ABOVE THIS COMMENT


    # ALL GAME LOGIC SHOULD GO BELOW THIS COMMENT

    # ALL GAME LOGIC SHOULD GO ABOVE THIS COMMENT


    # ALL CODE TO DRAW SHOULD GO BELOW THIS COMMENT
    screen.fill(black)

    screen.blit(background_image,[0,0])
    # ALL CODE TO DRAW SHOULD GO ABOVE THIS COMMENT
    pygame.display.flip()  

    clock.tick(20)

pygame.quit()

I get a file is not a valid windows BMP error. pygame.images.get_extended() returns 0

and

try:
   import SDL_image
   print "Loaded SDL_image"
except:
   print "Failed to import SDL_image"

try:
   import libpng
   print "Loaded libpng"
except:
   print "Failed to import libpng"

returns both failed import messages. I think thats all the tests i saw while searching for this and all of their solutions didnt work.

Upvotes: 1

Views: 2305

Answers (1)

Kava
Kava

Reputation: 103

I had the same problem, but I managed to solve it installing the following version of Pygame: http://pygame.org/ftp/pygame-1.9.1release-python.org-32bit-py2.7-macosx10.3.dmg

Upvotes: 1

Related Questions