<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta content="MSHTML 6.00.5346.5" name="GENERATOR">
<style title="owaParaStyle">P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</style>
</head>
<body ocsi="x">
<div><font face="Tahoma" color="#000000" size="2">We don't support compiled Python modules (PYD's or PYC's, I'm not sure which one pywin32 is though I'd bet PYD) and isn't anything we'll support before 1.0.&nbsp; But if it's access to Win32 you want, there's a large
 amount of Win32 exposed through the .NET APIs that you can access directly by importing the appropriate namespaces (and adding references to the appropriate assemblies if it's not mscorlib or System).&nbsp;
</font></div>
<div><font face="Tahoma" color="#000000" size="2"></font>&nbsp;</div>
<div><font face="Tahoma" color="#000000" size="2">That may or may not work for you depending on what your goals are.&nbsp;
</font></div>
<div><font face="tahoma" size="2"></font>&nbsp;</div>
<div><font face="tahoma" size="2"></font><font face="tahoma" size="2"></font>&nbsp;</div>
<div id="divRpF935597">
<hr tabindex="-1">
<font face="Tahoma" size="2"><b>From:</b> users-bounces@lists.ironpython.com On Behalf Of Mike Raath<br>
<b>Sent:</b> Tuesday, June 27, 2006 10:21 PM<br>
<b>To:</b> users@lists.ironpython.com<br>
<b>Subject:</b> [IronPython] &quot;no module named win32api&quot; using PyWin32-208<br>
</font><br>
</div>
<div></div>
<div>I posted this on the <span class="fontsize3"><b><a class="gl" href="http://groups.google.co.za/group/comp.lang.python" target="_blank">comp.lang.python</a>&nbsp;
</b></span>list yesterday but am not sure if that is the correct list to have posted on, so apologies for the cross-post but I would really appreciate some help on this.<br>
<br>
<p><font class="fixed_width" face="Courier, Monospaced">I have Python 2.4 installed on my local machine in c:\Python24. I have
<br>
also downloaded the python for windows extensions installer <br>
pywin32-208.win32-py2.4.exe and installed this to <br>
C:\Python24\Lib\site-packages <br>
</font></p>
<p><font class="fixed_width" face="Courier, Monospaced">Trying to run a python script through a C# console app is causing me
<br>
problems: the last line of code in the following block results in a no <br>
module named win32ap error. I'm not sure if this is because there is no <br>
win32api.py in the win32 folder off site-packages, just a win32api.pyc <br>
file. <br>
</font></p>
<p><font class="fixed_width" face="Courier, Monospaced">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_engine = new PythonEngine();
<br>
</font></p>
<p><font class="fixed_width" face="Courier, Monospaced">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_engine.AddToPath(&quot;C:\\Python24\\DLLs&quot;);
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_engine.AddToPath(&quot;C:\\Python24\\lib&quot;); <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_engine.AddToPath(&quot;C:\\Python24\\lib\\plat-win&quot;); <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_engine.AddToPath(&quot;C:\\Python24\\lib\\lib-tk&quot;); <br>
</font></p>
<p><font class="fixed_width" face="Courier, Monospaced">m_engine.AddToPath(&quot;C:\\Python24\\Lib\\site-packages\\pythonwin&quot;);
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_engine.AddToPath(&quot;C:\\Python24&quot;); <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_engine.AddToPath(&quot;C:\\Python24\\lib\\site-packages&quot;); <br>
</font></p>
<p><font class="fixed_width" face="Courier, Monospaced">m_engine.AddToPath(&quot;C:\\Python24\\lib\\site-packages\\win32&quot;);
<br>
</font></p>
<p><font class="fixed_width" face="Courier, Monospaced">m_engine.AddToPath(&quot;C:\\Python24\\lib\\site-packages\\win32\\lib&quot;);
<br>
</font></p>
<p><font class="fixed_width" face="Courier, Monospaced">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_engine.Execute(&quot;from win32api import win32api&quot;);
<br>
</font></p>
<p><font class="fixed_width" face="Courier, Monospaced">I have added all the addtopaths to get the path to match the sys.path I
<br>
see in a normal python console which can successfully import the <br>
module. <br>
</font></p>
<p><font class="fixed_width" face="Courier, Monospaced">Incidentally, I have tried making the last line
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;m_engine.Execute(&quot;import win32api&quot;); <br>
with no luck. <br>
</font></p>
<p><font class="fixed_width" face="Courier, Monospaced">Can the win32 extensions handle compiled python modules? If not how can
<br>
I get it to work? <br>
</font></p>
<font class="fixed_width" face="Courier, Monospaced">Thanks, <br>
Mike </font><br>
</div>
</body>
</html>