Maya import standalone

Viewed 402

I would like to run maya module code in an external editor (like VSCode) by NOT using mayapy.exe. Reason is that I am running a lot of other code as well, so cutting out the maya bit just to throw it in mayapy.exe is not really a great solution for me.

Therefore I need to create a maya standalone like this:

from maya import standalone
standalone.initialize()

My problem is that from maya import standalone obviously doesn't exist in VSCode. So I add this line at the top for that:

import sys
sys.path.append('C:\Program Files\Autodesk\Maya2020\Python\Lib\site-packages\maya')
from maya import standalone
standalone.initialize()

But I am still getting this error: ImportError: cannot import name standalone

Any idea how I can get standalone working from outside Maya?

0 Answers
Related