2017-09-07 76 views
2

我有Anaconda Python3.6。我一直在试图通过下面的方法重新安装的MacVim萨尔瓦多队长:MacVIM - Python 3错误

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 

我在网上看了一下,我发现Fedora上有类似的bug报告here

我也看了一下错误,并试图更新X-Code。问题是我现在不想通过操作系统进行升级,只想更新X-Code。我查看了App Store Update,并点击了“更新”,但似乎没有工作。当我点击“更新”时,它会停顿,没有任何反应。

所以,我抬头命令

softwareupdate --list 

和X-码不显示在那里。我在Stack Overflow上查找了this,评论似乎清楚地表明即使是选定的答案也是错误的。我不想升级我的操作系统,但我想用python3支持来安装MacVIM。我希望有人能帮我解决这个问题?

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

回答

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"更换或python3的Python.h的Mac上的路径。保存。 (cmd + s在崇高文本中)。

  3. 再次运行brew安装命令。一旦从终端看到 ==> Cloning https://github.com/macvim-dev/macvim.git ,它将会在第2步中混淆并覆盖之前的更改。因此,您必须密切关注来自崇高文本的if_python3.c。一旦您注意到第75行恢复为#include <Python.h>,立即按cmd + z,cmd + s恢复并保存更改。

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