pythoncom.CoInitialize() not recognised in Eclipse

Jason Scheirer jason.scheirer at gmail.com
Mon Mar 29 05:16:43 CEST 2010


On Mar 28, 7:14 pm, KB <ke... at nekotaku.com> wrote:
> Hi there,
>
> I have in the past used PythonWin to write python for COM, and
> switched to Eclipse.
>
> I am getting an error from the IDE saying it does not recognise
> CoInitialize():
>
> ****
> import pythoncom
>
> pythoncom.CoInitialize()
> pythoncom.CoUninitialize()
> ****
>
> (red X next to the two bottom lines saying: "Undefined variable from
> import: CoInitialize")
>
> If I open a PyDev/Python Console window in Eclipse, I can type the
> above, no errors, no problem.
>
> I tried removing my Python Interpreter and re-adding/re-building but
> no change.
>
> python 2.5.2
> eclipse 3.5.1
> pydev 1.5.0
>
> Thanks!

PyDev is probably only looking at functions/classes defined in Python
source files and not ones defined in C extensions.

To confirm, try typing this in the window:

import _ctypes
_ctypes._Pointer()

If it says that _ctypes._Pointer doesn't exist, then that's obviously
the problem.



More information about the Python-list mailing list