Skip to content
Advertisement

Decompiling PYC files for python 3.9.2 [duplicate]

Currently, I have a PYC file for the 3.9.2 version of python (P.S: This applies to all versions 3.9 and above). I’m trying to decompile the PYC file but it is showing an error as uncompyle6 (or rather, the newer version, decompyle3) is not compatible with Python versions 3.9 and above.

I was wondering if there are any alternative methods that can be used rather than decompyle3 to get the source of PYC files, or maybe a hacky fix.

P.S. I did already try to pip install decompyle3 but it says

ERROR: No matching distribution found for decompyle3

Advertisement

Answer

Sadly enough, it’s currently impossible. Decompile 3 has the latest pyc to py methods (decompilation), but it hasn’t updated for python 3.9 yet as that update takes a very long time to create.
And it will most likely never happen for 3.9 (the developer of decompyle3 said that he is focusing more on his main job and that he doesn’t have time to create this update as the 3.9 python update really changed the workflow, so it will be very hard and time-consuming).

So for now, the only solution is to wait, but if you want to speed things up, you can always sponsor the creator of decompile 3 (https://github.com/sponsors/rocky) (as he said that if you would get enough money to work more on this project, he will)

Edit:
I have recently found out that there is an alternative
I haven’t used it myself, but its meant to decompile the compiled
python file (.pyc) back to humanly readable code (.py). For any python version!
You can check it out here: https://github.com/zrax/pycdc

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement