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

[亡魂溺海] 提交于 2019-12-18 16:52:12

问题


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


回答1:


Maybe you must install libpng?

You can do it with homebrew:

brew install libpng



回答2:


Use python3 interpreter and it will work




回答3:


Try:

brew unlink libpng && brew link libpng

With me it was some problems with the linking.




回答4:


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/



来源:https://stackoverflow.com/questions/38645391/python-pygame-error-failed-loading-libpng-dylib-dlopenlibpng-dylib-2-imag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!