Wednesday, July 6, 2011

Re: Python plugin using PyWin32

On Jun 30, 10:35 am, Alexandre Martani <alexandre.mart...@gdx.com.br>
wrote:
> Hello all,
>
> I am trying to use Vim R plugin [1], which is a Python plugin that uses
> PyWin32 on Windows. I have installed Python 2.7.1 and PyWin32. It is
> installed correctly, as I am able to do a "import win32api" from python
> shell without errors. But, on GVim, if I do:
>
> :python import win32api
>
> I receive the following error:
>
> Traceback (most recent call last):
>      File "<string>", line 1, in <module>
> ImportError: DLL load failed: The specified module could not be found.
>
> Notice that this is not the standard error for module not found ("No
> module named x"). It is probably related to the path python uses for its
> DLL modules. I have played with sys.path, but without success.

I cannot reproduce your problem on my system:
Win2k; Vim 7.3.145; Python 2.6.5; pywin32-214.win32-py2.6.exe
installed
My PATH has Python's top level directory "C:\Python" where it's
installed and no subdirs or other Python-related stuff.

Some ideas:

1) Try after launching Vim with
"C:\Program Files\Vim\vim73\gvim.exe" -u NONE -U NONE

2) Examine sys.path from Vim
:py import sys; print sys.path
I have these
'C:\\Python\\lib\\site-packages'
'C:\\Python\\lib\\site-packages\\win32'
'C:\\Python\\lib\\site-packages\\win32\\lib'
'C:\\Python\\lib\\site-packages\\Pythonwin'

3) Perhaps you have several conflicting versions of Python or PyWin32
installed? 32- vs 64-bit?

4) Did you install PyWin as Admin? If not, try to reinstall.


> I also noticed the first path in sys.path is "C:\\must>not&exist", which
> is probably a bug. Don't know if this could be related, but I tried do a
> sys.path.pop(0), and it didn't work.

It used to be an empty string. It was changed to this bogus path for
some security reasons:
http://ftp.nluug.nl/vim/patches/7.2/7.2.045

--
You received this message from the "vim_use" 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

No comments: