天天看點

pyenv install --list的dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib錯誤修複

pyenv install --list

如果報錯:

Available versions:
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
  Referenced from: /usr/local/bin/awk
  Reason: image not found
/usr/local/bin/python-build: line 2000: 51283 Done                    sed 'h; s/[+-]/./g; s/.p\([[:digit:]]\)/.z.\1/; s/$/.z/; G; s/\n/ /'
     51285 Broken pipe: 13         | LC_ALL=C sort -t. -k 1,1 -k 2,2n -k 3,3n -k 4,4n -k 5,5n
     51286 Abort trap: 6           | awk '{print $2}'
           

原因:找不到

libreadline.7.dylib

解決辦法:把現在的版本,比如

libreadline.8.0.dylib

連接配接到

libreadline.7.dylib

即可

```shell
 brew reinstall readline
 ls /usr/local/opt/readline/lib/
 #如果發現libreadline.8.0.dylib,那麼:
 ln -s libreadline.8.0.dylib libreadline.7.dylib
 ``