question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pygame.error: File is not a Windows BMP file

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
topcatscommented, Feb 20, 2021

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

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

0reactions
topcatscommented, 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.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Pygame Error: File is not a windows BMP file - Stack Overflow
Pygame Error : File is not a windows BMP file · Delete Python 3 and reinstall Python 2.7 32-bit version (using the .dmg)...
Read more >
m1 Mac pygame.error: File is not a Windows BMP file #2458
If possible add a simple test program that shows the problem described in this report. import pygame pygame.image.load('chessboard.png').
Read more >
pygame.error: File is not a Windows BMP file - Reddit
pygame.error: File is not a Windows BMP file. I am on a mac and keep getting this error when trying to launch pyzero...
Read more >
pygame error: file is not a windows bmp file - Google Groups
Hello, all! "pygame error: file is not a windows bmp file". I couldn't found a solution for this problem. My python script run...
Read more >
[Solved]-File is not a Windows BMP File-eclipse - appsloveworld
I'm not on a mac, but I have two thoughts: First: I see no pygame.init(), which i learned should allways come first. Second:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found