Open bcipriano opened 4 years ago
IMO it is because lib2to3 fails to load the Grammar.txt file if it is located inside a .zip archive. Updating python zip file will work. Python community had updated pygram.py and driver.py to fix this issue.
https://bugs.python.org/issue24960 https://github.com/python/cpython/commit/770a802df7057bcf0d72bbc01026fac8d396e1b3 https://github.com/python/cpython/commit/417f76a20e93044e422fb328a2d8e200fc6df295
Not sure we can rely on studios patching their Maya installs with a new python.zip. If you're right though, then it's possible that newer versions of Maya won't have this issue if they ship with an updated Python... until then, this is what we did to make it work at my studio.
We commented out both the execfile import and the 'execfile(path, {})' line in loader.py (we're not using shell.py but iirc this happens there too) and dropped in this the parse_outline_script() method in it's place.
with open(path, 'r') as f:
outline_code = compile(f.read(), path, 'exec')
exec(outline_code, {}, {})
I believe this works on both Python 2 and 3... though I'm not 100% certain.
We commented out both the execfile import and the 'execfile(path, {})' line in loader.py (we're not using shell.py but iirc this happens there too) and dropped in this the parse_outline_script() method in it's place.
with open(path, 'r') as f: outline_code = compile(f.read(), path, 'exec') exec(outline_code, {}, {})
I believe this works on both Python 2 and 3... though I'm not 100% certain.
still getting same error in Maya 2018.4
root : Generating grammar tables from /foo/apps/maya2018/lib/python27.zip/lib2to3/Grammar.txt
Error: IOError: file /foo/apps/maya2018/lib/python27.zip/lib2to3/pgen2/pgen.py line 15: 20
Describe the bug The Maya plugin fails to load due to errors generated by one of the compatibility libraries we're using:
To Reproduce Steps to reproduce the behavior:
Expected behavior Plugin should load without error and an OpenCue shelf should appear in Maya.
Version Number 0.4.0