[IronPython] Importing standard Python libs

Michael Foord fuzzyman at voidspace.org.uk
Sat Feb 20 21:55:24 CET 2010

On 20/02/2010 15:53, Lukas Cenovsky wrote:
> Brian Curtin wrote:
>> On Sat, Feb 20, 2010 at 13:20, Lukas Cenovsky <cenovsky at bakalari.cz 
>> <mailto:cenovsky at bakalari.cz>> wrote:
>>     Lukáš Duběda wrote:
>>         Hi there everyone,
>>         I'm having problems importing a module, concretely win32com,
>>         from within
>>         IronPython.
>>         The problem is, when I run IronPython as a console, and add a
>>         path to
>>         the standard Python26 library, the module can be imported without
>>         any problems, but as soon as I try to embed IronPython and call
>>         it from within my application and then try to import the module,
>>         even though I'd added the path to the sys.path prior to
>>         importing the module, it still throws an error saying:
>>         "No module named win32api".
>>         I don't know what to do now. I've tried to manually add
>>         all the sub-directories of the Lib direcotry from Python26.
>>         I tried to copy the module's files to IronPython Lib directory,
>>         but nothing worked.
>>         Thanks a lot in advance, cheers,
>>     I don't know why you can't import the win32com module but I would
>>     not use it at all.
>>     I would rather use the Win32 API directly from IronPython via
>>     clrtype and pinvoke or via C# stub. For C# stub example see my
>>     blog: http://gui-at.blogspot.com/2008/07/simulate-users-input.html
>> What's wrong with win32com/win32api...?
> I think it is unecessary proxy level for accessing COM or win32api in 
> IronPython.

win32com and win32api (as far as I know) rely on C extensions and won't 
work on IronPython anyway (unless you are using Ironclad).

Michael Foord

> --
> -- Lukáš
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100220/cb2556d3/attachment.html>

More information about the Ironpython-users mailing list