MySQL Forums
Forum List  »  Connector/Python

Re: Bad magic number
Posted by: Jose Israel Gomez Delgado
Date: August 05, 2021 07:50AM

Hello Monika.

If you got an error saying, "bad magic number in...", It is probably that the compiled source was created in a different version of Python where is attempted to run.

Python puts a marker into its pyc files called magic number when it creates them. Then the python interpreter makes sure this number is correct when loading it. This magic number changes between the different versions of Python.

This issue can come from a bad installation (e.g Install new Python version without removing old in the same location) or by moving the installed Modules between different versions of Python. An uninstall and fresh Install of latest versions can solve the issue, if the problem persists, we need more details on how python and connector python where installed, like the versions and installation location.

Options: ReplyQuote


Subject
Written By
Posted
October 13, 2020 08:15AM
Re: Bad magic number
August 05, 2021 07:50AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.