6

I installed the FlapPyBird repo from https://github.com/sourabhv/FlapPyBird. I have libpng installed but when i try to run the program with python flappy.py i get

Failed loading libpng.dylib: dlopen(libpng.dylib, 2): image not found

Any ideas about whats wrong? Thanks

  • What is the output when you run `echo $DYLD_LIBRARY_PATH` in Terminal? (It should be empty.) – jkdev Sep 13 '16 at 03:59
  • Because it could be that your DYLD_LIBRARY_PATH was set permanently -- for example, in your ~/.bash_profile -- which is [almost always an indication that you are doing something wrong](http://stackoverflow.com/a/24964138/3345375). – jkdev Sep 14 '16 at 01:01

4 Answers4

1

Maybe you must install libpng?

You can do it with homebrew:

brew install libpng
Evgeny Palguev
  • 599
  • 3
  • 18
0

Use python3 interpreter and it will work

bryan
  • 11
  • 1
0

Try:

brew unlink libpng && brew link libpng

With me it was some problems with the linking.

Eruvanos
  • 670
  • 7
  • 13
0

I had the same issue. Installing the following with homebrew fixed it:

brew install sdl sdl_image sdl_mixer sdl_ttf portmidi

Got the info from here:

http://brysonpayne.com/2015/01/10/setting-up-pygame-on-a-mac/

Adam
  • 3
  • 2