问题
I'm trying to install Homebrew on my Mac os (macOS Mojave Version 10.14.3)
And I keep getting the following error (the exact message I see in my terminal):
dyld: Library not loaded: @rpath/libssl.1.0.0.dylib
Referenced from: /Users/[my_machine_name]/anaconda3/lib/libssh2.1.dylib
Reason: image not found
I see a lot of solutions mentioning some brew related commands as part of their solution, but I'm trying to install brew here so I don't have brew yet. I'm wondering what I need to do?
Edit:
I'm using the following command to install brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
回答1:
You can resolve the issue by installing libssh2 via conda environment manager.
conda install libssh2
回答2:
I had the same problem after upgrading to python 3.7 with conda. New git repos would produce the following error with git pull or git push
dyld: Library not loaded: @rpath/libssl.1.0.0.dylib
Referenced from: /Users/alexis/anaconda3/lib/libssh2.1.dylib
Reason: no suitable image found.
I'm on macOS 10.12.6 Sierra. Reinstalling libssl or git, updating brew did not fix it.
The fix was
conda update --prefix /Users//anaconda3 anaconda
I am now on
conda 4.6.9
回答3:
I finally figured what the problem was. The dylib couldn't be found. So I added the following line to the ~/.bash_profile (you can open this file using the nano ~/.bash_profile command or open it using any other editor than nano):
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/local/lib
This line simply tells where we should be looking for the dylibs. Just figure out where your dylibs are (in my case they are at /opt/local/lib) and add the path to the ~/.bash_profile file.)
Notice: This solution might potentially affect some other functionalities. But in my case, it helped to successfully install the Homebrew. It would be great if anyone shares a better solution if there's any.
来源:https://stackoverflow.com/questions/54564036/error-when-installing-homebrew-dyld-library-not-loaded-rpath-libssl-1-0-0-dy