[英]vim is broken after a brew upgrade
I tried to upgrade vim using brew upgrade vim
and I cannot make vim works anymore since then.我尝试使用
brew upgrade vim
,从那以后我再也无法让 vim 工作了。
The error message I get is:我得到的错误信息是:
dyld: Library not loaded: /usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/Python
Referenced from: /usr/local/bin/vim
Reason: image not found
Abort trap: 6
I tried the following:我尝试了以下方法:
brew uninstall vim
brew cleanup
brew install vim
but it did not solve the problem at all.但它根本没有解决问题。
I also completely removed the content of the .vimrc
file where some plugings were installed to check for python syntax.我还完全删除了
.vimrc
文件的内容,其中安装了一些插件来检查 python 语法。 Again, that did not change the error message I get.同样,这并没有改变我得到的错误信息。
I do not know what I am missing, and I would like to understand where the problem comes from.我不知道我错过了什么,我想了解问题出在哪里。
I have fixed the issue and it is kinda hack but whatever it works now :) My error was following:我已经解决了这个问题,它有点 hack 但不管它现在如何工作 :) 我的错误如下:
dyld: Library not loaded: /usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/Python
Referenced from: /usr/local/bin/vim
Reason: image not found
The issue was actually not having version 3.7 located on the path: /usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/
However I had 3.8
folder there...问题实际上是路径上没有 3.7 版:
/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/
但是我在那里有3.8
文件夹......
So I just made a sym link by doing所以我只是做了一个符号链接
$ ln -s 3.8 3.7
And yes I am aware that the fix should be changing reference from /usr/local/bin/vim
to use 3.8 instead of 3.7 but this works also and I did not have the time to dive in it further.是的,我知道修复程序应该将
/usr/local/bin/vim
引用更改为使用 3.8 而不是 3.7 但这也有效,我没有时间进一步深入研究。
I was facing the similar error but with different library :我遇到了类似的错误,但使用了不同的库:
dyld: Library not loaded: /usr/local/opt/lua/lib/liblua.5.3.dylib Referenced from: /usr/local/Cellar/macvim/....../MacOS/Vim Reason: image not found Abort trap: 6
and the workaround give above to add symlink to the available version in the /usr/local/opt/lua/lib directory helped.上面给出的解决方法是将符号链接添加到 /usr/local/opt/lua/lib 目录中的可用版本。
Below is what I did:以下是我所做的:
cd /usr/local/opt/lua/lib
$ ls
liblua.5.4.2.dylib liblua.5.4.dylib liblua.dylib liblua5.4.dylib pkgconfig
Above are the versions present in my lib dir and vi was trying to load : /usr/local/opt/lua/lib/ liblua.5.3.dylib .以上是我的 lib 目录中存在的版本,vi 试图加载: /usr/local/opt/lua/lib/ liblua.5.3.dylib 。
Running the below symlink helped and now i can open my vi editor as usual:运行下面的符号链接有帮助,现在我可以像往常一样打开我的 vi 编辑器:
ln -s liblua.5.4.dylib liblua.5.3.dylib ln -s liblua.5.4.dylib liblua.5.3.dylib
macvim
的包是比 OSX 中的vim
更好的选择,所以请尝试brew uninstall macvim
,然后brew install macvim
,它会清除与 python 相关的链接并重新创建它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.