【问题标题】:MacVIM - Python 3 ErrorMacVIM - Python 3 错误
【发布时间】:2018-02-15 19:00:35
【问题描述】:

我有 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

我在网上查了一下,发现有人报告了类似的错误 here 用于 Fedora。

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

所以,我查了命令

softwareupdate --list 

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

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

【问题讨论】:

    标签: xcode macos python-3.x vim macvim


    【解决方案1】:

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

    1. 首先,您需要从另一个编辑器打开有问题的 if_python3.c,例如崇高的文字。它通常位于 ~/Library/Caches/Homebrew/macvim--git/src/if_python3.c

    2. 转到第 75 行,将 #include &lt;Python.h&gt; 替换为 #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 &lt;Python.h&gt;,立即按 cmd+z、cmd+s 恢复并保存更改。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-12-24
      • 2015-11-09
      • 1970-01-01
      • 2018-03-14
      • 2017-02-23
      • 2018-05-30
      • 2018-05-24
      • 2018-08-05
      相关资源
      最近更新 更多