我用的是蟒蛇3.6。我一直在尝试通过以下方法在El船长上重新安装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
我在网上看过了,我发现在Fedora的here上也有类似的bug。
我还查看了这个错误,并尝试更新X-Code。问题是,我不想在这个时候通过操作系统升级,只想更新X-Code。我查看了App Store的更新,点击了“更新”,但它似乎不起作用。当我点击“更新”,它停止,没有任何反应。
所以,我查了一下命令
softwareupdate --list
X代码不会出现在那里。我在Stack Overflow上查找了this,评论似乎清楚地表明,即使是选择的答案也是错误的。我不想升级我的操作系统,但我想安装支持python3的MacVIM。我希望有人能帮我解决这个问题?
注意:我没有尝试卸载Macports或Fink (不确定这是什么)。错误中提到了这一点。移走或移动它们会有帮助吗?我只是不想做任何我以后可能会后悔的事。
发布于 2017-12-31 21:55:47
即使使用Xcode 8.2.1,我也遇到了同样的问题。编译在同一位置停滞。经过几次尝试,我找到了一种变通方法。
~/Library/Caches/Homebrew/macvim--git/src/if_python3.c
#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路径。省省吧。( sublime文本的安装)。==> Cloning https://github.com/macvim-dev/macvim.git
,它就会自动拉出并覆盖你之前在步骤2中所做的更改。因此,你必须密切关注来自sublime文本的if_python3.c。注意到行75恢复为#include <Python.h>
后,立即按cmd+z、cmd+s恢复并保存更改。我使用了这个技巧并成功地构建了macvim。
https://stackoverflow.com/questions/46089574
复制相似问题