Link to home
Start Free TrialLog in
Avatar of spectrumsofttech
spectrumsofttechFlag for India

asked on

How can I solve Bad Magic Error?

While running Django Project run server getting Bad Magic Error.How can I solve the Problem ? Using python2 and Django 1.8 User generated image
Avatar of Florian Lenschow
Florian Lenschow

This could be caused by the first few bytes of any .pyc file Python generates, as discussed in this Stack Overflow question whats the bad magic number error.
So removing these files and running your python script again afterwards could fix it.
Avatar of spectrumsofttech

ASKER

But .pyc files not generated during running. it throws an exception before it.
Weird indeed. It seems to be caused by the django.mo file having a corrupt magic header (signalling big or little endian), but I can't really tell why. Maybe reinstalling django could fix it?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.