1

I'm trying to use Py2app to make apps from python. When I run the command line python3 setup.py py2app. it runs successfully, but when I couldn't open my standalone, and I got an error says:

background = pygame.image.load('bg.png')
pygame.error: File is not a Windows BMP file

Can anybody point me out how to fix this problem?

ps: I'm on Mac os Mojave 10.14.6, pygame 2.0.0.dev6 (SDL 2.0.12, python 3.8.2)

Rabbid76
  • 202,892
  • 27
  • 131
  • 174
Velma
  • 11
  • 1
  • Welcome to SO! You might take the [Tour](https://stackoverflow.com/tour) and you should (re-)read the help topic [How to Answer](https://stackoverflow.com/help/how-to-answer) to get a feeling on how to contribute. You should always explain your code and format it so that others can read and understand it. – stackprotector May 19 '20 at 19:23
  • PyGame 2 is still in testing, and they're up to `dev7`. You might be better off post a bug report: https://www.pygame.org/wiki/patchesandbugs – Kingsley May 19 '20 at 23:05
  • Hi @Velma, if your program works when running from source, it's probably not a library issue. I'd guess it has something to do with bundling the resources within the app. Perhaps [this question](https://stackoverflow.com/questions/16434632/how-to-directly-access-a-resource-in-a-py2app-or-py2exe-program) will help, but providing a [mcve] will make it easier to assist you with your problem. – import random May 20 '20 at 01:11

1 Answers1

0

this worked for me -

sudo apt-get install git curl libsdl2-mixer-2.0-0 libsdl2-image-2.0-0 libsdl2-2.0-0 libsdl2-ttf-2.0-0
Striped
  • 2,544
  • 3
  • 25
  • 31
Larry
  • 1