Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib #3806

Closed
lenhhoxung86 opened this issue Mar 11, 2016 · 4 comments
Closed

Comments

@lenhhoxung86
Copy link

Hello, I'm new to caffe and I'm installing it on my MacbookPro (Yosemite). Everything is fine except the final step "make runtest". It throws the following error:

.build_release/tools/caffe
dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
  Referenced from: /usr/local/opt/opencv/lib/libopencv_highgui.2.4.dylib
  Reason: image not found
make: *** [runtest] Trace/BPT trap: 5

I've located libpng16.6:
locate libpng16.16.dylib
/Library/Python/2.7/site-packages/matplotlib/.dylibs/libpng16.16.dylib
/usr/local/Cellar/libpng/1.6.21/lib/libpng16.16.dylib
Can you help fix?

@ShaggO
Copy link

ShaggO commented Mar 18, 2016

I'm guessing you're using homebrew. You need to make sure homebrew has linked your libpng in /usr/local/lib. Try fixing it using "brew link libpng". On a sidenote: This is a usage-related question and should probably be moved to the mailing list. I think it's safe to close the issue.

@lenhhoxung86
Copy link
Author

Thank you. Your suggestion works for me. Everything worked after I ran the command below:
brew link --overwrite libpng

@jerpint
Copy link

jerpint commented May 3, 2016

you might need to change permissions too : https://thornelabs.net/2014/12/08/libpng-not-symlinking-when-installing-imagemagick-on-os-x-yosemite.html

Run the following

sudo chown -R my_osx_short_username:admin /usr/local/share/man/man5
brew link libpng

@dpip
Copy link

dpip commented Feb 7, 2018

My application would accept certain images then reject others with similar error messages.

ERROR in ./src/images/cat.png Module build failed: Error: dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib Reason: image not found

My fix was a reinstall of libpng 💩 tcoopman/image-webpack-loader#60

brew install libpng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants