遇到錯誤:> pymel.internal.startup : ERROR : maya.standalone was successfully > initialized, b > ut pymel failed to import maya.cmds (or it was not populated) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "C:\Program > Files\Autodesk\Maya2014\Python\lib\site-packages\pymel\core\_ > _init__.py", line 11, in <module> > _startup.mayaInit() > File "C:\Program > Files\Autodesk\Maya2014\Python\lib\site-packages\pymel\intern > al\startup.py", line 170, in mayaInit > from maya.cmds import about > ImportError: cannot import name about 解決辦法: 必須得先import maya.standalone且init了之后,再import各種maya內(nèi)部模塊才能成功
import maya.standalone try: maya.standalone.initialize(name='python') except: sys.stderr.write( "Failed in initialize standalone application" ) raise import maya.cmds as cmds import pymel.core as pm |
|