OS mac
Published : 2020-11-18   Lastmod : 2021-11-15

## Cause

After uploading an image recognition library called dlib, when I try to use tig or awk, I get

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
Referenced from: /usr/local/bin/awk


The reason seems to be that during the dlib installation, cmake was upgraded and mac readline was upgraded from 7 to 8. tig and awk are not yet ready for readline 8, so the error seems to occur. As of November 2020, there is no problem with tig, but only with awk for now.

As of November 2020, there is no problem with tig. (It’s pretty frustrating when Shell bugs out…)

## Solutions I’ve used before

When I had the same problem in the spring of 2019, I was able to solve it using the method shown here.

As described in “Pattern 2: I did a homebrew cleanup.

brew unlink readline


This was fixed by bash brew unlink readline brew install cj-bc/cj-bc/readline The cmake upgrade cleaned up and removed the readline7 series, so pattern 1 did not work this time.

## The solution that worked this time.

I tried to run the same command again, but it didn’t fix the problem, and after some trial and error, the following worked.

ln -s /usr/local/opt/readline/lib/libreadline.dylib /usr/local/opt/readline/lib/libreadline.7.dylib