Need help about import Maya module

Greetings everyone.I’ve learned python scripting in Maya just for a short time.I engaged a (stupid) problem when i followed a tutor.

I’ve set the systempath and environment variable already and tried to run Maya in the IDLE.The tutor told me i should input these commands below:

>>import maya.standalone
>>maya.standalone.initialize()

Problem poped out here.My Maya’s version is not the “standalone"version as the tutor but the “2009 Service Pack 1a x64”. i could not proceed that via any methods.I tried the “.2009”,”.SP1ax64",".ServicePack1a",etc…

So,anyideas?Thx very much.:tear::tear:

it would be nice if you can post exact error message.

I wonder what version/bit of python you are using.
Seems like you are using maya2009 64bit so python2.5/64bit is what you should use.

The tutor showed me how to startup Maya and create a Maya scene via python directly.The tutor’s example was like this:

>>import maya.standalone
>>maya.standalone.initialize()

So i input commands below:

>>import maya.SP1ax64
>>maya.SP1ax64.initialize()
it didn’t work.

So I’m not quiet sure that’s the python’s version leads to this,'coz i can run python well.I just wonder whether you guys engaged such problem and how did you describe or input you Maya version in the command before.I’ll keep on check it deeply,thanks a looooot anyway YutaA bro ~ waiting for more suggestions :]

Couple things to try:
Make sure a reference to Maya’s site-packages lib is either on your sys.path or PYTHONPATH

Make sure the bitdepth of the IDLE you’re running is the same as the bitdepth of the Maya you’re running.

pretty sure it needs to be import maya.standalone regardless of what version of maya you have.

If you fail to import maya.standalone, make sure the maya path is in your python system path, to do this you need to do

import sys
sys.path.append(“C:\Program Files\Autodesk\Maya2008\Python\lib\site-packages”)

then you should be able to import maya.standalone

Done~ Thx a lot for your help,dj,Ikruel…All you bros~

His job was to be attack somebody too, so now aion gold that job is state paw to me. I am susceptible, but lower compliant. On top of the another responsibilities, I am stuck doing this congested indication too. Burnout hits us all very strong. The tributary factors include lack of gear aion gold motivation, lack of new useable thing, decrease actuation, and lots of (simple) wipes.

Hi everyone

i declared the environment variable but still i got problem, i checked sys.path and path is there.
in mayapy.exe everything is working fin and i make a cube and save it.

this is in python IDEL

>>> import sys
>>> print sys.path
[‘C:\Python26\Lib\idlelib’, ‘C:\Program Files\Autodesk\Maya2010\Python\lib\site-packages’, ‘C:\WINDOWS\system32\python26.zip’, ‘C:\Python26\DLLs’, ‘C:\Python26\lib’, ‘C:\Python26\lib\plat-win’, ‘C:\Python26\lib\lib-tk’, ‘C:\Python26’, ‘C:\Python26\lib\site-packages’]

my maya is 2010 and checked mayapy version and is 2.6.1
my python 2.6.6 which is replaced to 2.6.1

this is the error that i got:tear:

>>> import maya.standalone

Traceback (most recent call last):
File “<pyshell#0>”, line 1, in <module>
import maya.standalone
ImportError: DLL load failed: The specified module could not be found.

i check the C:\Program Files\Autodesk\Maya2010\Python\DLLs and there is sqlite3.dll file aswell

please help

I’ve seen cases where you need to add %MAYA_LOCATION%/bin to %PATH% in order for it to work.

Is Maya installed to your system path?