virtualenv and Maya

て烟熏妆下的殇ゞ 提交于 2019-12-06 08:05:48

Download the latest virtualenv and call it virtualenv with the version of python you want to virtualize:

/usr/autodesk/maya/bin/mayapy where/i/saved/virtualenv mayapy

An alternative that's good for unittesting without messing with your maya runtime environment is to run your tests inside an instance of maya.standalone. If your tests all include something like this:

import maya.standalone
try: 
    maya.standalone.initialize()
except:
    pass # initialize raises if you call it more than once, but it's harmless if you catch it.

you can run them from the mayapy intepreter without running maya in gui mode.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!