I'm getting an error with Uncompyle6 and Decompyle3 after getting the bytecode from pyinstxtractor

 I got this error when I tried Uncompyle6 uncompyle6 main.pyc :


Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Scripts\uncompyle6.exe\__main__.py", line 4, in <module>

...more lines

  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\xdis\std.py", line 73, in __init__
    self.opc = opc = get_opcode_module(python_version, variant)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\xdis\op_imports.py", line 174, in get_opcode_module
    return op_imports[canonic_python_version[vers_str]]
                      ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: '3.11.2'

So, I tried Decompyle3. Yet, I get the same error. I tried Decompyle3 because "it accepts bytecodes from Python version 3.7 on." I'm using Python 3.11.

So, if that's not gonna work, then what should I do???

PS: Is there any other software that could do this? I think something is wrong with my Python version.


he error you're seeing is related to a missing opcode module in the xdis package, which is used by uncompyle6 and decompyle3 to disassemble bytecode. It seems that the version of xdis you have installed does not support Python 3.11.

One possible solution is to downgrade your Python version to 3.10, which is currently supported by xdis. Another option is to install a development version of xdis that supports Python 3.11.

To install the development version of xdis, you can use the following command:

ruby
pip install https://github.com/rocky/python-xdis/archive/develop.zip

This will install the latest development version of xdis from GitHub.

Alternatively, you can try using another bytecode decompiler, such as uncompyle2 or uncompyle3, which may work with Python 3.11 bytecode.

To install uncompyle2, you can use the following command:

pip install uncompyle2

To install uncompyle3, you can use the following command:

pip install uncompyle3

After installing either of these decompilers, you can use them to decompile your .pyc file. For example, to decompile main.pyc using uncompyle2, you can use the following command:

css
uncompyle2 main.pyc > main.py

Comments