467,076 Members | 883 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,076 developers. It's quick & easy.

"no module named win32api" using PyWin32-208

Hi.

I have Python 2.4 installed on my local machine in c:\Python24. I have
also downloaded the python for windows extensions installer
pywin32-208.win32-py2.4.exe and installed this to
C:\Python24\Lib\site-packages

Trying to run a python script through a C# console app is causing me
problems: the last line of code in the following block results in a no
module named win32ap error. I'm not sure if this is because there is no
win32api.py in the win32 fikder off site-packages, just a win32api.pyc
file.

m_engine = new PythonEngine();

m_engine.AddToPath("C:\\Python24\\DLLs");
m_engine.AddToPath("C:\\Python24\\lib");
m_engine.AddToPath("C:\\Python24\\lib\\plat-win");
m_engine.AddToPath("C:\\Python24\\lib\\lib-tk");

m_engine.AddToPath("C:\\Python24\\Lib\\site-packages\\pythonwin");
m_engine.AddToPath("C:\\Python24");
m_engine.AddToPath("C:\\Python24\\lib\\site-packages");

m_engine.AddToPath("C:\\Python24\\lib\\site-packages\\win32");

m_engine.AddToPath("C:\\Python24\\lib\\site-packages\\win32\\lib");

m_engine.Execute("from win32api import win32api");

I have added all the addtopaths to get the path to match the sys.path I
see in a normal python console which can successfully import the
module.

Incidentally, I have tried making the last line
m_engine.Execute("import win32api");
with no luck.

Can the win32 extensions handle compiled python modules? If not how can
I get it to work?

Thanks,
Mike

Jun 27 '06 #1
  • viewed: 3370
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Copelandia Cyanescens | last post: by
134 posts views Thread by James A. Donald | last post: by
2 posts views Thread by Gabriele *darkbard* Farina | last post: by
reply views Thread by Robert Dailey | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.