When running any Python script (by double clicking a .py file on Windows 7) I’m getting a Python: failed to set __main__.__loader__ error message. What to do?
More details:
- The scripts work on other machines.
- The only version of Python installed on the machine on which the scripts don’t work is 3.2.
- I get the same error when trying to run the script from the Windows shell (cmd).
-
Here’s an example for the content of a file named “hey.py” that I failed to run on my machine:
print('hey')
I had the same problem. Turns out it was because the file was stored in a directory with a name not in English (Hebrew in my case).
Make sure the path to the file contains only English letters.
http://bugs.python.org/issue16218