понедельник, 16 апреля 2012 г., 18:27:00 UTC+4 пользователь MarcWeber написал:
> > Let me try to get more details from vim + python configure output.
> > Standalone that python version is fine. I can do from os import
> > urandom but from within vim it fails.
>
> I'm not entirely sure but I vaguely remember than python on linux uses
> statically linked python whereas python on windows uses python dlls..
Depends entirely on compilation options, but it I never saw it linked
*statically*: I mean, when no external python library is required. Main
difference: in linux you are likely to have python library linked by system
linker (like ld-linux.so), on windows you are likely to use vimLoadLib which
uses LoadLibrary which is probably defined in some windows header files: I see
ifdef PYTHON
ifndef DYNAMIC_PYTHON
DYNAMIC_PYTHON=yes
endif
<...>
in src/Make_ming.mak, so this is the default. Besides, it is convenient for
package maintainers: without package manager which will install dependencies
for you requiring to install all interpreters is a pain for users and having
all possible combinations of interpreters support is a pain for maintainers. I
can compile dynamically linked python-enabled vim executable that uses system
linker if you wish.
If you saw my python-extended branch, I can say that in order to make both
pythons work (thus test all modifications without recompilation) at the same
time I have no options other then using dlopen (--with-python*interp=dynamic).
>
> This in turns means that vim uses that python version which vim's
> makefiles finds first (which may not be your local python at all, but
> the traces hint that it does).
It will do so in any case unless you saw an executable when vim is linked
really statically.
>
> you can try that import random (or whatever fails) within vim and python
> and compare traces (which .py files are read by vim) and or compare
> sys.path to get an idea what might be happening.
>
> Marc Weber
By the way, latest vim compiled with python (2.7.3) support succeeds at
from os import urandom
on win32 (wine), but python was installed from msi package to default location.
In order to do so I have the following variables:
PYTHON={C}/Python27
PYTHONINC=-I$PYTHON/include
. If you compile using mingw with Make_ming.mak be sure they are set to proper
values ({C} in my case is ~/.wine/dosdevices/c:, but Make_ming.mak is not only
for cross-compiling). Also be sure that your custom python is in your $PATH (in
my case it is C:\Python27) and it goes before any other python (at least when
launching vim), python msi package is not adding it, make or whatever you used
to compile python definitely won't add it also. If there are still differences,
follow Marc Weber's advice.
--
You received this message from the "vim_dev" 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