Mario-Level-1 icon indicating copy to clipboard operation
Mario-Level-1 copied to clipboard

pygame.error: File is not a Windows BMP file

Open jojoo- opened this issue 11 years ago • 4 comments

i got the following error with the recent version from github:

 jojoo@soy% python mario_level_1.py
 Traceback (most recent call last):
   File "mario_level_1.py", line 10, in <module>
     from data.main import main
   File "/private/tmp/Mario-Level-1/data/main.py", line 3, in <module>
     from . import setup,tools
   File "/private/tmp/Mario-Level-1/data/setup.py", line 25, in <module>
     GFX   = tools.load_all_gfx(os.path.join("resources","graphics"))
   File "/private/tmp/Mario-Level-1/data/tools.py", line 115, in load_all_gfx
     img = pg.image.load(os.path.join(directory, pic))
 pygame.error: File is not a Windows BMP file

jojoo- avatar Feb 23 '14 13:02 jojoo-

Try reinstalling pygame. Make sure both python and pygame are 32 bit. Also, you can check if each dependency installed correctly.

justinmeister avatar Feb 23 '14 16:02 justinmeister

your pygame is install not comolete, I have meet this problem months ago

you can try sudo apt-get install python-pygame if your system is ubuntu/debian

lowbox avatar Mar 03 '14 12:03 lowbox

All the images used are png files, so it's fine. But BMP might face a problem based on the code below: def load_all_gfx(directory, colorkey=(255,0,255), accept=('.png', 'jpg', 'bmp')):

jpg and bmp don't have '.' and will not be accepted

bejohn avatar Mar 11 '15 06:03 bejohn

self.image = pygame.image.load('images/player.png') pygame.error: File is not a Windows BMP file I tried to uninstall pygame completely under pip site-packages, and then reinstalled, but the error still appeared

MagicTmac1 avatar Sep 07 '21 12:09 MagicTmac1