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
In my case, I've git clone
a lib which had an interpreter of
#!/usr/bin/env python
While python
was leading to Python2.7
even though my main code was running with python3.6 ... it still created a *.pyc
file for 2.7
version ...
I can say that this error probably is a result of a mix between 2.7 & 3+ versions, this is why cleanup ( in any way you can think of that you're using ) - will help here ...