Running tests with mayapy.exe give: "ImportError: No module named os"

Hey,

Strange things started happen recently. I'm pretty sure I was able to run the unittests before, but somehow it just stopped working.

When trying to run my tests I'm getting the following error:
"C:\Program Files\Autodesk\Maya2014\bin\mayapy.exe" "C:\Program Files (x86)\JetBrains\PyCharm 4.0.1\helpers\pycharm\utrunner.py" E:\Projects\nodex\test.py true
Testing started at 23:35 ...
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 4.0.1\helpers\pycharm\utrunner.py", line 17, in <module>
    os = import_system_module("os")
  File "C:\Program Files (x86)\JetBrains\PyCharm 4.0.1\helpers\pycharm\pycharm_run_utils.py", line 33, in import_system_module
    f, filename, desc = imp.find_module(name)
ImportError: No module named os

Process finished with exit code 1
prettyPrint();

When doing 'import os' in my code it just runs fine so I'm not sure what is messing up the interpreter.
Note that mayapy.exe is the python interpreter that comes with Autodesk Maya.

What would be the next step towards debugging what's going on here? (And solving this!)
Also reinstalled Pycharm just to be sure, though it didn't do the trick.

Cheers,
Roy

  • EDIT*: Just checked with another version of Maya (2015) and it seemed raise the same error (same machine).

Funny thing is that:
import os
prettyPrint();

Above works as expected.
Yet the following results in an "ImportError":

import imp
imp.find_module("os")
prettyPrint();
1 comment
Comment actions Permalink
Here's some more information.

http://stackoverflow.com/questions/24092084/how-to-run-pycharm-unittests-when-standard-lib-is-zipped

Still not sure how I would use that to fix this particular issue on my end.
0

Please sign in to leave a comment.