3

How is it possible to run import win32api successfully on a 64bit maya version 2008?

The following error occurs:

Error: No module named win32api
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named win32api

I need to get mouse cursor position in python so that I can place window exactly in that position. Is there any other way to get it?

Best regards,

kNish

mechanical_meat
  • 163,903
  • 24
  • 228
  • 223
nish
  • 1,008
  • 4
  • 17
  • 34
  • Trying to rule out the obvious: You have installed the 64-bit Python for Windows extensions from http://sourceforge.net/projects/pywin32/ right? – mechanical_meat Apr 21 '10 at 05:45
  • correct me iiaw http://sourceforge.net/projects/pywin32/files/ suggests pywin32-214.win-amd64-py2.6.exe. This py2.6 is for maya2009 not 2008. i need pywin32-214.win-amd64-py2.5.exe ( 64bit, py2.5 ). – nish Apr 21 '10 at 12:21

1 Answers1

1

Maya uses its own Python installation. You need to add the path where pywin32 is installed by one way or another ... you can create a .pth file in

C:\Program Files\Autodesk\Maya2009\Python\Lib\site-packages\

Also, like Adam pointed out, make sure you have the 64 bit pywin32 installed.

Here's an article talking about this subject:

http://www.rtrowbridge.com/blog/2008/11/27/maya-python-import-scripts/

Edit:

Yeah indeed I think they don't provide PyWin32 for Python25 x64:

Available for AMD64 versions of Windows for Python 2.6 and later (support for Python 2.5 is just too hard, sorry). Lots of help from Roger, Steve Yin and Sidnei da Silva.

http://sourceforge.net/project/shownotes.php?release_id=603349