Skip to main content

SOLVED: PhantomJS 2.5 Beta: Library not loaded: libwebp.6.dylib

After installing PhantomJS 2.5 Beta on MacOS, I ran into the following error after trying to get the version:
dyld: Library not loaded: /usr/local/opt/webp/lib/libwebp.6.dylib

After some research, I found out that the library behind it ‘webp’ had been updated to libwebp.7.dylib.

Step 1: Install webp via Homebrew

If you have a Mac and are a developer, I assume that you already have homebrew installed. If you don’t know what this means, you can checkout the homebrew site at: https://brew.sh

  1. Before starting, ensure your homebrew installation is up to date brew update
  2. Install webp: brew install webp

Step 2: Add a symlink for libwebp.6.dylib to reference libwebp.7.dylib

  1. Close and re-open, or open another terminal window
  2. Browse to your webp lib directory cd /usr/local/opt/webp/lib
  3. Look at the directory for the library file ls
  4. If you see libwebp.7.dylib, add the symlink ln -s libwebp.7.dylib libwebp.6.dylib
  5. If you see a version different from libwebp.7.dylib, you can try the other version in place of libwebp.7.dylib in the example above

Step 3: Test it out

  1. Close all of your previous terminal windows and open up a new one
  2. Try checking the PhantomJS version again: phantomjs --version

Comments

  1. Charlie B.

    Rock on!

  2. Ryan McCormick

    You’re welcome! The library discrepancy is just a side effect of beta where releases are sporadic and off schedule. A good prod release would follow OS vendor releases and updates.

  3. Moreno

    You just saved my day, thank you! Is there any reason why they don’t use libwebp.7.dylib in the first place?

Leave a Reply

Your email address will not be published. Required fields are marked *