Python Forum
can't use pyrepl: bad magic number in 'enum'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can't use pyrepl: bad magic number in 'enum'
#1
Greetings,

How can I resolve the following error? Can't use pyrepl: bad magic number in 'enum' : b'\xd1\xf2\r\n' ?
I am using Python 3.13.4.

Thank you.
Reply
#2
It probably means that you have a compile .pyc file on python module search path that was compiled with another version of Python.

This should not normally happen, but we don't know what you did to make it happen. You could try to remove the faulty .pyc file (perhaps a enum.pyc file?)
« We can solve any problem by introducing an extra level of indirection »
Reply
#3
Good point, Gribouillis. I’ve seen this happen when there are old .pyc files from a different Python version. You can try deleting all .pyc files by running:

bash
Copy
Edit
find. -name "*.pyc" -delete
That usually helps clear up the “bad magic number” errors. Also, make sure you're not mixing files from different Python versions in your environment.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020