Loading ...
Sorry, an error occurred while loading the content.

macvim compiles with wrong python version (and not working with needed version)

Expand Messages
  • ilya belsky
    In brief: I have a problem with compiling macvim with preferred python version. When I use --enable-pythoninterp it compiles with system OSX python version.
    Message 1 of 1 , Sep 6, 2011
    • 0 Attachment

      In brief:

      I have a problem with compiling macvim with preferred python version.
      When I use --enable-pythoninterp it compiles with system OSX python version.
      When I use --enable-pythoninterp=dynamic I get an error in vim while trying :py import sys

      Here is what I was doing in more detail:

      % git clone https://github.com/b4winckler/macvim.git
      % cd macvim
      % ./configure --enable-pythoninterp \
           --with-python-config-dir=/usr/local/lib/python2.7/config <- this option has no affects on result
      ...
      checking for python... /usr/local/bin/python
      checking Python version... 2.7
      checking Python is 1.4 or better... yep
      checking Python's install prefix... /usr/local
      checking Python's execution prefix... /usr/local
      checking Python's configuration directory... /usr/local/lib/python2.7/config
      ...
      % make
      ...
      ** BUILD SUCCEEDED **
      % open src/MacVim/build/Release/MacVim.app

      In the opened MacVim I type:

      :py import sys; print (sys.version, sys.executable)
      ('2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
        [GCC 4.2.1 (Apple Inc. build 5646)]'
      ,
       
      '/usr/bin/python')

      Why 2.6.1?
      Why /usr/bin/python?
      My default python is 2.7! And it lives at /usr/local/bin/python

      I was searching for solution all day. And I found it. It is =dynamic attribute (but this solution had not explanation).

      After that I tried to recompile vim with dynamic python:

      % ./configure --enable-pythoninterp=dynamic
      ... output the same ...
      % make
      % open src/MacVim/build/Release/MacVim.app

      In opened MacVim:

      :py import sys

      And here comes an error:

      E370: Could not load library libpython2.7.a
      E263: Sorry, this command is disabled, the Python library could not be loaded.

      My OSX version is 10.6.8.
      Default python version is 2.7.

      % which python
      /usr/local/bin/python

      Can anybody explain how python is integrating into vim during the compilation?
      And how to fix the error with libpython2.7.a?

      --
      You received this message from the "vim_mac" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    Your message has been successfully submitted and would be delivered to recipients shortly.