View Full Version : pywin32 maya 2013
06-26-2012, 11:26 AM
i cant import this now that i'm using maya 2013, anyone else had this problem?
06-29-2012, 10:58 AM
pywin32 was never part of mayapy. Install it into the full 2.6 interpreter, and share the libraries with maya.
06-29-2012, 05:27 PM
that's not the problem but thanks for the bump, figured it would be a given that i would have installed it to py2.6, and appended mayapy's sys.path but i guess i should have been more clear, from the reading i have done it would seem that mayapy 2013 and pywin32 have been compiled by different versions of vs and this may be causing the dlls to not load, but i dont really know anything about this compiling stuff so i'm not sure, btw this module loads just fine in idle, and maya 2011/2012
06-29-2012, 05:55 PM
Given my behind... people ask here how to print hello world.
First, make sure that the required dlls are x64 as your maya.
Second, even if one was compiled on vs 2005, and the other on vs 2010, there shouldn't be a problem to run them both in conjunction. But make sure that the required dlls are x64 and in the path. For example vs 2010 x64 redist. Although it doesn't make sense that the dlls are missing and you can still use pywin on previous maya versions.
Third, if everything fails try to get hold of the sources and build them yourself.
Also you didn't provide the exact error message.
06-29-2012, 06:44 PM
I think that my second point isn't entirely accurate. A win app can load any version, and the os has limitations only on the x32, x64 issue. So building a plugin to maya can be done in any compiler.
But I do remember that python for some reason might have an issue with it, and the official compiler for python 2.6 is vc9 (vs2008):
Notice that you should use the same version of VC++that was used to build Python itself.
And see if this helps
The last time I had a problem with it, while compiling a python extension, I didn't bothered to get to the bottom of this, and just used vc9 as was required.
If python has that limitation, and maya broke the standards and built its own python version with a different compiler, then it's the dumbest thing I heard about autodesk this week. :p
By the way, do you have the same issues running a standalone pywin script with mayapy?
06-29-2012, 09:52 PM
yeah, its all 64 bit, i have no idea whats wrong, it works fine in 2012, same results runing script with mayapy too
06-30-2012, 08:08 AM
So you didn't understand my point about vc, and the error message is a secret.
No matter. You actually don't need pywin at all. Instead use:
from ctypes import *
inc = windll.LoadLibrary(dllPath)
out = inc.required_function()
Where dllPath is the dll that contains the winapi command that you require, and required_function is the winapi command name (Of course if windll contains what you want that just use it directly).
I tested it on 2013.
09-05-2012, 05:31 AM
I'm having the same issue with pywin32. Works fine for 2012, no go in 2013.
I'm win32net.NetUseEnum... really a pain to get this functionality a different way.
09-05-2012, 07:24 AM
More info about the problem:
And as I suggested in the post before your post, use ctypes and load the dll manually. Alternatively try to compile the package yourself using vs2010 (good luck with that...).
09-05-2012, 09:08 PM
I'm trying your ctypes import, but I'm getting an error.
Trying to use the win32net.pyd. Is that handled differently than a .dll?
09-06-2012, 04:32 AM
Please provide a short code the reproduces the error.
I didn't understand your question. I have no idea what's inside the .pyd, and I can't see why you care about it. You are trying to use the winapi function:
, which, as written in the bottom of the page, resides in Netapi32.dll.
See if this link helps you
09-06-2012, 03:33 PM
I guess I saying that you can't load a .pyd using ctypes, since it expects you to import a .pyd.
I'll look into the links you sent. Looks useful.
09-06-2012, 06:25 PM
Please read again my previous post. I emphasize again, you don't need the .pyd you need only the .dll.
09-06-2012, 06:25 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.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.