I'm pretty sure you need to: import maya.standalone maya.standalone.initialize()
...before you can refer to any of the maya.cmds functions. - Ofer www.mrbroken.com On Sun, Jan 30, 2011 at 5:48 AM, Taylor Carrasco <[email protected]>wrote: > *The python interpreter I chose under In Eclipse, in my Preferences - > PyDev - Interpreter, is C:\Program Files\Autodesk\Maya2011\bin\mayapy.exe > > In the Libraries tab I have the following ~* > > > C:\Program Files\Autodesk\Maya2011\Python > C:\Program Files\Autodesk\Maya2011\Python\DLLs > C:\Program Files\Autodesk\Maya2011\Python\lib > C:\Program Files\Autodesk\Maya2011\Python\lib-tk > C:\Program Files\Autodesk\Maya2011\Python\plat-win (this doesnt even exist, > not sure why mayapy added this) > C:\Program Files\Autodesk\Maya2011\bin > C:\Program Files\Autodesk\Maya2011\bin\python26.zip > C:\eclipse\plugins\org.python.pydev_1.6.2.2010090812\PySrc > > C:\Program Files\Autodesk\Maya2011\Python\Lib\site-packages > > > > > On Sun, Jan 30, 2011 at 4:22 PM, Taylor Carrasco > <[email protected]>wrote: > >> I have looked already, I googled "mayapy, eclipse, environment", "mayapy, >> environment", "maya, environment, eclipse", etc >> I also searched through these threads before posting. >> >> I had found a thread which led to this ~ >> http://www.luma-pictures.com/tools/pymel/docs/1.0/eclipse.html >> However, that is what I had already done, except remove ..../site-packages >> and put it again to the bottom (for auto completion) >> >> Again, I continue to have the same issue as described in my initial post. >> >> >> import maya >> print 'maya\n', dir(maya) >> >> from maya import cmds >> print 'cmds\n', dir(cmds >> ) >> >> # this should return a function object, something like <built-in method >> sphere of module object at 0x0000000019F0EEE8> >> print 'sphere', cmds.sphere >> >> maya >> [’__builtins__’, ‘__doc__’, ‘__file__’, ‘__name__’, ‘__package__’, >> ‘__path__’] >> cmds >> [’__builtins__’, ‘__doc__’, ‘__file__’, ‘__name__’, ‘__package__’, >> ‘__path__’] >> >> Traceback (most recent call last): >> line 11, in <module> >> print 'sphere', cmds.sphere >> AttributeError: 'module' object has no attribute 'sphere' >> >> On Sun, Jan 30, 2011 at 4:12 AM, Judah Baron <[email protected]>wrote: >> >>> You don't need to add environment vars. You need to set your interpreter >>> paths up in pydev, and the paths associated with your projects. You will >>> also need to point to a special "completion" directory so you get more than >>> an empty cmds module. Search this thread for it, or do a general web search >>> - there's plenty of coverage. >>> >>> On Fri, Jan 28, 2011 at 11:34 PM, Taylor Carrasco < >>> [email protected]> wrote: >>> >>>> I'm just trying to set up my environment variables for Maya 2011 and >>>> Windows 7 >>>> >>>> I’m using Eclipse, and have not been able to get any of maya.cmds to >>>> work >>>> importing maya.cmds works, however a dir on maya and cmds results in the >>>> following >>>> >>>> I’ve tried adding “*C:\Program >>>> Files\Autodesk\Maya2011\Python\Lib\site-packages*” to Eclipse’s >>>> PYTHONPATH, but have no idea what to add to my computers Environment >>>> variables. >>>> >>>> Can someone give me a list of what environment variables I need to >>>> change on the computer to get this to work properly, the following should >>>> show a lot more available methods right? >>>> import maya >>>> print 'maya\n', dir(maya) >>>> >>>> from maya import cmds >>>> print 'cmds\n', dir(cmds) >>>> >>>> maya >>>> [’__builtins__’, ‘__doc__’, ‘__file__’, ‘__name__’, ‘__package__’, >>>> ‘__path__’] >>>> cmds >>>> [’__builtins__’, ‘__doc__’, ‘__file__’, ‘__name__’, ‘__package__’, >>>> ‘__path__’] >>>> >>>> -- >>>> http://groups.google.com/group/python_inside_maya >>>> >>> >>> -- >>> http://groups.google.com/group/python_inside_maya >>> >> >> > -- > http://groups.google.com/group/python_inside_maya > -- http://groups.google.com/group/python_inside_maya
