MacVIM - Python 3错误

问题描述 投票:2回答:1

我有Anaconda Python3.6。我一直试图通过以下方法在El Captain上重新安装MacVIM:

brew tap macvim-dev/macvim
brew install --HEAD macvim-dev/macvim/macvim --with-properly-linked-python2-python3

我按照安装MacVIM here的说明进行操作

我收到以下错误:

if_python3.c:75:10: fatal error: 'Python.h' file not found
#include <Python.h>
     ^
1 error generated.

make[1]: *** [objects/if_python3.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [first] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/macvim-dev/homebrew-macvim/issues


Error: Your Xcode (7.3.1) is outdated.
Please update to Xcode 8.2.1 (or delete it).
Xcode can be updated from the App Store.


Error: You have MacPorts or Fink installed:
  /opt/local/bin/port

This can cause trouble. You don't have to uninstall them, but you may want to
temporarily move them out of the way, e.g.

  sudo mv /opt/local ~/macports

我已经在网上查看过,我发现有一个类似的bug报道了Fedora的here

我也查看了错误并尝试更新X-Code。问题是我不想在此时通过操作系统升级,只想更新X-Code。我查看了App Store更新,然后点击了“更新”,它似乎没有用。当我点击“更新”时,它会停止并且没有任何反应。

所以,我查了一下命令

softwareupdate --list 

和X-Code没有出现在那里。我在Stack Overflow上查找了this,评论似乎清楚地表明即使选择的答案也是错误的。我不想升级我的操作系统,但我想安装支持python3的MacVIM。我希望有人可以帮我这个吗?

注意:我没有尝试卸载Macports或Fink(不确定这是什么)。这在错误中提到。移除或移动它们会有帮助吗?我只是不想做任何我可能会后悔的事情。

xcode macos python-3.x vim macvim
1个回答
0
投票

即使使用Xcode 8.2.1,我也遇到了同样的问题。汇编在同一个地方停滞不前。经过多次尝试,我找到了解决方法。

  1. 首先,您需要从另一个编辑器打开有问题的if_python3.c,例如崇高文本。它通常位于~/Library/Caches/Homebrew/macvim--git/src/if_python3.c
  2. 转到第75行,用#include <Python.h>替换#include "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/include/python3.6m/Python.h",或者在mac上用python3的Python.h路径替换。保存。 (崇高文本中的cmd + s)。
  3. 再次运行brew install命令。一旦你从终端看到 ==> Cloning https://github.com/macvim-dev/macvim.git ,它将git pull并覆盖你在步骤2中的先前更改。所以你必须密切关注来自sublime文本的if_python3.c。一旦您注意到第75行恢复为#include <Python.h>,请立即按cmd + z,cmd + s恢复并保存更改。

我用这个技巧并成功构建了macvim。

© www.soinside.com 2019 - 2024. All rights reserved.