What”s the bad magic number error?

| | | | | | | | | | | | |

What"s the "Bad magic number" ImportError in python, and how do I fix it?

The only thing I can find online suggests this is caused by compiling a .py -> .pyc file and then trying to use it with the wrong version of python. In my case, however, the file seems to import fine some times but not others, and I"m not sure why.

The information python"s providing in the traceback isn"t particularly helpful (which is why I was asking here...), but here it is in case it helps:

Traceback (most recent call last):
  File "run.py", line 7, in <module>
    from Normalization import Normalizer