python win32api install issues

427 views
Skip to first unread message

hapgilmore

unread,
Mar 18, 2011, 1:56:11 PM3/18/11
to python_inside_maya
I'm attempting to import the win32api module. (Win7 64, Maya 2011)

1) Downloaded the installer here http://sourceforge.net/projects/pywin32/files/pywin32/Build216/
2) Installed it into a clean Python26.
3) Copied all the added files from site-packages into a folder added
to Maya's PYTHONPATH
4) in maya, import win32api
5) # Error: ImportError: file <maya console> line 1: No module named
win32api #

It's not a PYTHONPATH issue, as I can import other modules from the
same folder.
Any other suggestions?

-Ian

Jesse Kretschmer

unread,
Mar 18, 2011, 2:56:45 PM3/18/11
to python_in...@googlegroups.com, hapgilmore

I have always accomplished this by appending the system path in the code before calling any external packages.  It is best to maintain a separate install of python 2.6 and any modules you might wish to use.

Try this:
import sys

sys.path.append('C:/Python26/Lib/site-packages/win32')

import win32api


-jesse



Amorano

unread,
Mar 19, 2011, 4:35:32 PM3/19/11
to python_inside_maya
Sorry if this is a stupid question, Maya 2011 x64?

A) If you are importing into Maya, Python26 has nothing to do with
Maya, Maya has it's own interpreter.
B) If it is 64 bit, the pywin32/win32com libaraies wont work because
they are linked to the 32bit DLLs.

Cheers.

On Mar 18, 9:56 am, hapgilmore <hapgilm...@hotmail.com> wrote:
> I'm attempting to import the win32api module. (Win7 64, Maya 2011)
>
> 1) Downloaded the installer herehttp://sourceforge.net/projects/pywin32/files/pywin32/Build216/
Reply all
Reply to author
Forward
0 new messages