Skip to content
New issue

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

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

Already on GitHub? # to your account

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

Open
keenan-v1 opened this issue Jun 13, 2020 · 7 comments
Open

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

keenan-v1 opened this issue Jun 13, 2020 · 7 comments

Comments

@keenan-v1
Copy link

Raspberry Pi 4 running Raspbian Buster Slim using the Adafruit 7" Touchscreen display.

Using ./run.sh gets me to this error message:

Traceback (most recent call last):
  File "lcars.py", line 8, in <module>
    config.SOUND)
  File "/home/pi/rpi_lcars/app/ui/ui.py", line 30, in __init__
    self.screen.setup(self.all_sprites)
  File "/home/pi/rpi_lcars/app/screens/authorize.py", line 16, in setup
    all_sprites.add(LcarsBackgroundImage("assets/lcars_screen_2.png"),
  File "/home/pi/rpi_lcars/app/ui/widgets/background.py", line 14, in __init__
    self.image = pygame.image.load(image).convert()
pygame.error: File is not a Windows BMP file

I've verified that Pillow is installed and all needed libraries are installed. Any assistance would be appreciated.

@FCPTRiddle
Copy link

I have the same exact problem, running Raspberry Pi 4 with 4gb memory and Raspbian Buster full OS on a 10.1 inch touch screen display. Please help

@tobykurien
Copy link
Owner

I searched the error message and found some posts, maybe this is relevant: https://stackoverflow.com/questions/25120883/how-to-uninstall-pygame-on-mac-osx-10-9-4

@topcats
Copy link

topcats commented Feb 20, 2021

just had the same issue after dist-upgrade to Buster.

the resolution was the fact the SDL libraries were not installed.

@FCPTRiddle
Copy link

FCPTRiddle commented Feb 21, 2021 via email

@topcats
Copy link

topcats commented Feb 22, 2021

The easiest way, will be install using the command line

  1. Open a terminal window
  2. sudo apt update
  3. sudo apt install libsdl-gfx1.2-5 libsdl-image1.2 libsdl-kitchensink1 libsdl-mixer1.2 libsdl-sound1.2 libsdl-ttf2.0-0 libsdl1.2debian libsdl2-2.0-0 libsdl2-gfx-1.0-0 libsdl2-image-2.0-0 libsdl2-mixer-2.0-0 libsdl2-ttf-2.0-0
  4. Try again, all should be good.

@Scinape
Copy link

Scinape commented Feb 8, 2023

Thank you very much! I met the same problem on my Raspberry Pi, thanks to you it's solved :)

@bluush
Copy link

bluush commented Mar 7, 2023

nice one, was chasing my tail for a while and topcats instruction fixed it.

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

No branches or pull requests

6 participants