Fixing 'dyld: Library not loaded' Errors on macOS: OpenSSL and Shared Library Guide

intermediate๐ŸŽ macOS2026-04-05| macOS (Intel or Apple Silicon), Homebrew, Terminal-based applications, Python/Ruby/Node.js environments.

Error Message

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib Referenced from: /usr/local/bin/wget Reason: image not found
#dyld#macos-error#openssl#homebrew-fix#terminal#dylib

Why Does This Error Happen?

If you have ever seen a dyld: Library not loaded message, you have run into the macOS dynamic linker. This error occurs when an application tries to open a shared library (a .dylib file) that is missing from its expected path. It is a frequent frustration for developers using Homebrew. Usually, it happens right after a brew upgrade or a major macOS update.

The error typically looks like this in your terminal:

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/bin/wget
  Reason: image not found

In this example, wget is searching for OpenSSL 1.0.0. However, Homebrew might have updated your system to OpenSSL 3.0, deleting the older 1.0.0 files to save space. This leaves your older tools stranded.

Step 1: Track Down the Broken Dependency

First, you need to confirm exactly which library is missing. Do not guess. You can use the otool command to look inside the failing binary and see its requirements.

otool -L /usr/local/bin/wget

This command prints every shared library the app relies on. Scan the list for paths involving /usr/local/opt/openssl/ or /opt/homebrew/opt/. If a file listed there does not exist on your hard drive, you have found the source of the crash.

Step 2: The Best Fix โ€” Reinstall the Software

The cleanest solution is to force the application to recognize your newer libraries. Reinstalling the software through Homebrew triggers a re-link, which usually points the app to the correct version of OpenSSL or other dependencies.

Refresh Homebrew

brew update
brew upgrade

Reinstall the App

If wget or postgres is the app causing trouble, run a reinstall command:

brew reinstall wget

Sometimes an app specifically requires an older version of OpenSSL that Homebrew no longer installs by default. If the error persists, you can try installing the 1.1 compatibility version:

brew install openssl@1.1

Step 3: Using Symlinks as a Last Resort

You might be stuck with a proprietary tool or an old Python 3.7 environment that you cannot easily reinstall. In these tight spots, you can trick the system by creating a symbolic link. This points the old path the app wants to the new library file you actually have.

Use caution: This is a temporary band-aid. If the new library version has changed significantly, the app might crash with a Symbol not found error later.

# Mapping version 1.1 to the old 1.0.0 path
ln -s /usr/local/opt/openssl/lib/libssl.1.1.dylib /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
ln -s /usr/local/opt/openssl/lib/libcrypto.1.1.dylib /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib

Remember that Apple Silicon Macs (M1, M2, M3) use /opt/homebrew as the base path, while Intel Macs use /usr/local. Double-check your path before running these commands.

Step 4: Adjusting Global Environment Paths

If the library file exists but the system simply cannot see it, you may need to update your shell profile. Add the library path to your .zshrc or .bash_profile to help macOS find it.

export DYLD_LIBRARY_PATH="/usr/local/opt/openssl/lib:$DYLD_LIBRARY_PATH"

After saving the file, refresh your terminal by running source ~/.zshrc.

How to Confirm It Works

Try running your application again. If it starts up without the dyld message, you have solved it. For extra peace of mind, run otool one last time:

otool -L /usr/local/bin/wget

Verify that the paths listed now match files that actually exist in your file system.

Security and File Integrity

When you manually move library files or download them from third-party sources to fix these errors, you risk introducing security holes. A corrupted or tampered .dylib file can compromise your entire development environment.

Professional developers often use a Hash Generator to verify library integrity. By checking the SHA-256 checksum of a library against official documentation, you ensure the file is safe and untampered. This 30-second check can prevent major security headaches down the road.

Key Takeaways

  • Homebrew Updates: Running brew upgrade often breaks older tools by removing the specific library versions they need.
  • Processor Architecture: Always verify if you are on Intel (/usr/local) or Apple Silicon (/opt/homebrew). Paths are not interchangeable.
  • Prioritize Reinstalls: Reinstalling an app is always safer than symlinking. Symlinks are fragile and can cause unpredictable behavior if the library's internal structure has changed.

Related Error Notes