PDA

View Full Version : Getting pyWin32 Modules to work with Maya


Jocose
09-06-2009, 06:33 AM
I am trying to install the pywin32 modules in Maya's site-packages folder so that I can use the win32clipboard module but every time I try to import the module it says it can't find it. The only way I can get a different result is to copy the win32clipboard module out of its directory hierarchy and into the main site-packages directory, but then it says it can't find some other files.

Is it possible to get the win32clipboard module to work with Maya? I was able to get other modules working, I don't understand why this one isn't being picked up.

jtilden20
09-08-2009, 03:10 AM
Maya has its own install of Python that comes with it (its actually in a zip file). If you have the Pywin32 package installed in your regular python install package, then Maya doesn't know about it. To make Maya aware of your site-packges folder (or any other directory, for that matter), you need to modify your Python search path. This can be done two ways:

1. - Through the PYTHONPATH environment variable (or inside of the maya.env file in your documents/maya folder)

2. - Modifying the script path at runtime with the sys module (sys.path.append(pathToAppend))

CAUTION:
If you want to link together external folders to your Python install for Maya, ensure the modules and scripts in those folders are compatible with Maya's Python version.

To check the version of any Python interpreter, use this:
import sys
print sys.version

This works in Maya as well. Hope this helps!
-J

Als
04-22-2010, 03:34 PM
I got this error:

import _tkinter # If this fails your Python may not be configured for Tk
Any ideas?

Maya python is 2.5.1,
I've installed 2.5.4 (couldn't find 2.55 installation package, nor 2.5.1)

Thanks


Als

CGTalk Moderation
04-22-2010, 03:34 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.