1

I'm trying to convert this .pyc file into a .py file. I accidently lost the .py file, and I need to make some edits to my code. I was trying to use the Easy Python Decompiler, but keep getting the error, "Invalid pyc/pyo file - Magic value mismatch!" and I don't know what it means or how to fix it.

https://i.stack.imgur.com/wze1U.png

Matt
  • 11
  • 2
  • 1
    Does this answer your question? [Is it possible to decompile a compiled .pyc file into a .py file?](https://stackoverflow.com/questions/5287253/is-it-possible-to-decompile-a-compiled-pyc-file-into-a-py-file) – Will Da Silva Jun 13 '21 at 20:37
  • Usually this problem is caused by a versioning mismatch. Please check if the Python version in use of the decompiler matches the Python version of your pyc file. – Vu Tung Lam Jun 14 '21 at 04:48
  • @VuTungLam I just checked the download website where I got the file and it says it should work for versions 1.0 to 3.4. I believe the .pyc file was made in Python 3.7.2. Is there a version that exists for 3.7 files? – Matt Jun 14 '21 at 20:03
  • @Matt I think you should go for this: https://pypi.org/project/uncompyle6/ Easy Python Decompiler seems a bit outdated. – Vu Tung Lam Jun 15 '21 at 01:22
  • 1
    @VuTungLam That worked. Uncompyle6 is a much better application that only requires a simple pip install. Thanks for your help! – Matt Jun 16 '21 at 05:29

0 Answers0