Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pygame.error: File is not a Windows BMP file #8

Open
jojoo- opened this issue Feb 23, 2014 · 4 comments
Open

pygame.error: File is not a Windows BMP file #8

jojoo- opened this issue Feb 23, 2014 · 4 comments

Comments

@jojoo-
Copy link

jojoo- commented Feb 23, 2014

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
@justinmeister
Copy link
Owner

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

@lowbox
Copy link

lowbox commented Mar 3, 2014

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

@bejohn
Copy link

bejohn commented Mar 11, 2015

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

@MagicTmac1
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants