[capi-sig] Win64 Vim: sys.path not set correctly

George V. Reilly george at reilly.org
Mon Oct 29 08:18:46 CET 2007


As you may know, Vim has offered an embedded Python for several years.
I'm updating the Win64 port of Vim and decided to make the Python
interface work too.

I think I've fixed all the tedious Py_ssize_t issues, and the simple
sanity test of
  :py print "hi"
works. However, more complex examples fall over with ImportErrors. As
far as I can tell, it's related to sys.path, which shows as:
  ['', 'd:\\Python25\\python25.zip', '.\\DLLs', '.\\lib',
'.\\lib\\plat-win', '.\\lib\\lib-tk', 'D:\\vimsrc\\vim7\\src']

When I run python interactively, sys.path looks like:
  ['', 'd:\\Python25\\python25.zip', 'd:\\Python25\\DLLs',
'd:\\Python25\\lib', 'd:\\Python25\\lib\\plat-win',
'd:\\Python25\\lib\\lib-tk', 'd:\\Python25',
'd:\\Python25\\lib\\site-packages']

If I modify sys.path to use the fully qualified pathnames, things
start working. If I build a 32-bit version of Vim, things work out of
the box.

I'm loading python25.dll; i.e., Vim was compiled with
-DDYNAMIC_PYTHON. The python25.dll was installed by
python-2.5.1.amd64.msi.

My patches (and the complete if_python.c) can be found at
http://www.georgevreilly.com/vim/vim-win64-20071028.zip

Any ideas?

Thanks.
-- 
/George V. Reilly
http://www.georgevreilly.com/blog


More information about the capi-sig mailing list