1

I'm getting this error pygame.error: Failed loading libpng.dylib: dlopen(libpng.dylib, 2): image not found when running a program on OSX (10.11.6) using Python 2.7

I've tried following this but I've had no luck and I can't seem to find much else on this issue. Any help on this would be greatly appreciated.

Community
  • 1
  • 1
GoodPie
  • 967
  • 3
  • 23
  • 41
  • 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
  • @jkdev I have no output when running that – GoodPie Sep 16 '16 at 03:48
  • OK, so that isn't the issue. – jkdev Sep 16 '16 at 15:17
  • Is libpng installed on your system? (Run a Finder search for Name matches: libpng) – jkdev Sep 16 '16 at 15:18
  • No it's not. I will install it now Edit: It was already installed but was outdated. I updated it via brew and the error still persists. – GoodPie Sep 17 '16 at 02:00

1 Answers1

-1

Use python3 interpreter in terminal e.g. python3 xx.py

bryan
  • 11
  • 1