2

I have Anaconda Python3.6. I have been trying to reinstall MacVIM on El Captain by the following method:

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

I followed the instructions from the installation of MacVIM here

I get the following error:

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

I have looked online and I see that a similar bug has been reported here for Fedora.

I also looked at the error and tried to update X-Code. The thing is that I don't want to upgrade by OS at this time and just want to update X-Code. I looked in the App Store Update and I clicked "Update" and it doesn't seem to be working. When I click "Update", it stalls and nothing happens.

So, I looked up the command

softwareupdate --list 

and X-Code does not show up there. I looked up this on Stack Overflow and the comments seem to clearly indicate that even the selected answer is wrong. I don't want to upgrade my OS but I want to install MacVIM with python3 support. I was hoping someone can help me regarding this?

Note : I have not tried to uninstall Macports or Fink (not sure what this is). This is mentioned in the error. Would the removal or movement of them help? I just don't want to do anything I might regret later.

Rahul P
  • 2,493
  • 2
  • 17
  • 31

1 Answers1

0

I had the same problem even with Xcode 8.2.1. The compilation stalled at the same place. After several attempts, I found a workaround.

  1. Firstly, you need to open the problematic if_python3.c from another editor, e.g. Sublime Text. It is normally situated at ~/Library/Caches/Homebrew/macvim--git/src/if_python3.c

  2. Go to line 75, replace the #include <Python.h> with #include "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/include/python3.6m/Python.h", or the path of Python.h of python3 on your mac. Save it. (cmd+s in sublime text).

  3. Run the brew install command again. Once you see ==> Cloning https://github.com/macvim-dev/macvim.git from the terminal, it will git pull and overwrite your previous change in step 2. So you must take a close eye on if_python3.c from sublime text. Once you notice the line 75 reverted back to #include <Python.h>, immediately press cmd+z, cmd+s to recover and save the change.

I used this trick and successfully built macvim.

George
  • 1
  • 1