Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import maya.standalone
ImportError: No module named maya.standalone
这是我的条件:
PYTHONPATH
设置为sitepackages
文件夹,MAYA_LOCATION
设置为Maya根文件夹site-packages
地址附加到sys.path
dll
个文件位于此地址%:\Program Files\Autodesk\Maya2014\Python\DLLs
我将环境设置为上面的地址并仍然得到相同的错误
为什么我要将PYTHONPATH环境设置为%:\Program Files\Autodesk\Maya2014\Python\Lib\site-packages
?
我需要一个解决此错误的确切指南
答案 0 :(得分:3)
以下代码可能会帮助您将标准Python 2.6作为与Maya挂钩的独立外部解释器。
################################################################
import os
import sys
#======================================================#
#THESE ARE THE MISSING STUFF WHEN RUNNING pythonw.exe
#======================================================#
os.environ["MAYA_LOCATION"] = "C:\Program Files\Autodesk\Maya2014"
os.environ["PYTHONHOME"] = "C:\Program Files\Autodesk\Maya2014\Python"
os.environ["PATH"] = "C:\\Program Files\\Autodesk\\Maya2014\\bin;" + os.environ["PATH"]
sys.path.append("C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\setuptools-0.6c9-py2.6.egg")
sys.path.append("C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\pymel-1.0.0-py2.6.egg")
sys.path.append("C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\ipython-0.10.1-py2.6.egg")
sys.path.append("C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\ply-3.3-py2.6.egg")
sys.path.append("C:\Program Files\Autodesk\Maya2014\\bin\python26.zip")
sys.path.append("C:\Program Files\Autodesk\Maya2014\Python\DLLs")
sys.path.append("C:\Program Files\Autodesk\Maya2014\Python\lib")
sys.path.append("C:\Program Files\Autodesk\Maya2014\Python\lib\plat-win")
sys.path.append("C:\Program Files\Autodesk\Maya2014\Python\lib\lib-tk")
sys.path.append("C:\Program Files\Autodesk\Maya2014\\bin")
sys.path.append("C:\Program Files\Autodesk\Maya2014\Python")
sys.path.append("C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages")
import maya.standalone
maya.standalone.initialize(name='python')
################################################################