loading the correct python27.dll on Windows

221 views
Skip to first unread message

Christian Brabandt

unread,
Jul 3, 2016, 7:09:44 AM7/3/16
to vim...@vim.org
Hi,
I have been trying to compile Vim on appveyor against the new 2.7.12
python library. As far as I can tell, I setup all needed environment
variables
set PYTHON_DIR=c:\python2712
set PYTHON_VER=27
set DYNAMIC_PYTHON=yes

And I even put PYTHON_DIR at the beginning of the PATH, so that this
python installation will be found before the system wide installation of
2.7.11 in c:\python27

Vim compiles and links fine, however, when I issue:
python import sys; print sys.version
I see this:
https://ci.appveyor.com/project/chrisbra/vim-win32-installer-33v6e/build/70/job/bp8929sxxq9ci070#L955
2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:40:30) [MSC v.1500 64 bit
(AMD64)]

Can someone tell me, how Vim is finding the wrong python27.dll?

Also I tried playing around with setting PYTHONHOME variable, while this
seems to work for python2 it breaks python3, since then the python3
interpreter also looks in the wrong place to load its modules.

Setting pythondll doesn't work, since you cannot specify the path to
use. So what would be the prefered way to load a specific dll?

Logfiles:
- Vim compiled against python 2.7.12, but uses still 2.7.11
https://ci.appveyor.com/project/chrisbra/vim-win32-installer-33v6e/build/70

- Setting pythonhome makes python3 unhappy:
https://ci.appveyor.com/project/chrisbra/vim-win32-installer-33v6e/build/68/job/vwx9xc062l11xath

Best,
Christian
--
Der Chef ist ein Mensch wie alle anderen, er weiß es nur nicht.

Ken Takata

unread,
Jul 3, 2016, 8:22:49 AM7/3/16
to vim_dev, vim...@vim.org
Hi Christian,

2016/7/3 Sun 20:09:44 UTC+9 Christian Brabandt wrote:
> Hi,
> I have been trying to compile Vim on appveyor against the new 2.7.12
> python library. As far as I can tell, I setup all needed environment
> variables
> set PYTHON_DIR=c:\python2712
> set PYTHON_VER=27
> set DYNAMIC_PYTHON=yes
>
> And I even put PYTHON_DIR at the beginning of the PATH, so that this
> python installation will be found before the system wide installation of
> 2.7.11 in c:\python27
>
> Vim compiles and links fine, however, when I issue:
> python import sys; print sys.version
> I see this:
> https://ci.appveyor.com/project/chrisbra/vim-win32-installer-33v6e/build/70/job/bp8929sxxq9ci070#L955
> 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:40:30) [MSC v.1500 64 bit
> (AMD64)]
>
> Can someone tell me, how Vim is finding the wrong python27.dll?

The python27.dll is normally installed into C:\Windows\System32 (64 bits) or
C:\Windows\SysWOW64 (32 bits). If the installer doesn't overwrite the dll,
it might happen. I'm not sure your installation command does overwrite the
python27.dll in the system directory.

Regards,
Ken Takata

Christian Brabandt

unread,
Jul 3, 2016, 4:52:22 PM7/3/16
to vim...@vim.org
Ah, I didn't check there.

Well, the installation didn't replace the system python27.dll? Are you
saying I need to replace that one? I tried installing using msiexec /A
but that didn't help. Then I tried replacing
c:\windows\{SysWOW64,system32}\python27.dll and that seems to work.
Not sure, this is worth the trouble for the vim-win32-installer
repository.

Best,
Christian
--
Leben ist die Kunst, taugliche Schlußfolgerungen aus unzureichenden
Prämissen zu ziehen.
-- Samuel Butler
Reply all
Reply to author
Forward
0 new messages