Getting error when using maya2egg2018

Hello, I am completely new to Panda3D and is just trying to follow various pages in the manual. I wanted to import a model from Maya to Panda3D, but failed. I use Maya 2018 and tried to run maya2egg2018 but got this error:

MAYA_LOCATION: C:\Program Files\Autodesk\Maya2018
Fatal Python error: initfsencoding: unable to load the file system codec
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 963, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 906, in _find_spec
  File "<frozen importlib._bootstrap_external>", line 1280, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1254, in _get_spec
  File "<frozen importlib._bootstrap_external>", line 1235, in _legacy_get_spec
  File "<frozen importlib._bootstrap>", line 441, in spec_from_loader
  File "<frozen importlib._bootstrap_external>", line 594, in spec_from_file_location
  File "C:\Program Files\Autodesk\Maya2018\bin\\encodings\", line 123
    raise CodecRegistryError,\
SyntaxError: invalid syntax
Program exited with status 3221226505

I have tried to Google it, but could not find any errors like this one and I do not understand what it means. Do you have any idea what it means and how I fix it? I have Python 3.7 installed (also 3.4, but not with Panda3D) and it seems, that Maya run Python 2.7. Could that be the issue? It happens no matter which arguments I give the command. I hope you can help me resolve this. Thank you!

Hi, welcome to the community!

I think there has to be some confusion with paths between Maya’s copy of Python and a different copy of Python (such as Panda’s), but it’s not immediately clear what it could be. maya2egg does not require anything from Panda’s copy of Python.

Did you install Panda3D via pip, or from the .exe installer?

1 Like

Thank you! I am excited to be here.

I installed Panda3D via pip.

I’ve just tested this on the 1.10.4 pip build, and attempted using maya2egg2019, and got the same issue. From my brief testing the issue doesn’t occur on a .exe installer.

1 Like

Hmm, noted. This is interesting. I suspect that the way it is installed via pip tries extra hard to make sure it uses the Python version that it was installed into, which in this case is interfering with Maya’s copy of Python. Perhaps there is another path we should be clearing from the environment variables in mayapath.cxx in this case.

Until we investigate this further, I recommend using the .exe installer to use the Maya converters. To ensure that this issue doesn’t get forgotten, you could consider filing this in the issue tracker.

1 Like

Thanks to both of you! I installed the .exe instead and it works now. I also filed an issue on GitHub.