Skip to main content

Extract PyInstaller-packed executables to .pyc files

Project description

depyinstaller

Extract PyInstaller-packed executables back to Python source .pyc files.

  • Automatically detects the Python version embedded in the executable
  • If your Python version doesn't match, tells you exactly which version to use
  • Filters out stdlib, third-party dependencies, and PyInstaller bootstrap files — only outputs your source code
  • Supports PyInstaller 2.0 ~ 6.19.0, Python 3.6+

Install

pip install depyinstaller

Usage

python -m depyinstaller -F <exe_file> -n <output_dir>

Example

python -m depyinstaller -F app.exe -n output

If the Python version matches, you'll get a clean output directory containing only user source .pyc files:

output/
  main.pyc
  pkg/
    __init__.pyc
    mod.pyc

If the version doesn't match:

[!] Python version mismatch: this exe requires Python 3.8, but you are running Python 3.14

[*] To fix this, install and run depyinstaller with Python 3.8:
      pip install depyinstaller  # using Python 3.8
      python -m depyinstaller -F app.exe -n output

How it works

  1. Extract — parses the PyInstaller archive (CArchive + PYZ) and extracts all embedded files
  2. Filter — identifies user source code by:
    • Selecting entry point scripts (excluding PyInstaller bootstrap like pyiboot*, pyi_rth_*)
    • Dynamically detecting third-party packages from binary extensions (.pyd/.so) and .dist-info metadata in the archive
    • Filtering out stdlib modules
    • Tracing imports recursively from entry points to find all user modules
  3. Output — copies only user .pyc files to the output directory, preserving the original package structure

License

GPL-3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

depyinstaller-0.1.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

depyinstaller-0.1.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file depyinstaller-0.1.0.tar.gz.

File metadata

  • Download URL: depyinstaller-0.1.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for depyinstaller-0.1.0.tar.gz
Algorithm Hash digest
SHA256 06ad76b916c020dc265da97d461ff7845c27a0bdd08d8e310830fddda09f114b
MD5 84feac3c560afa4a8e9eaa5bb7b5bb71
BLAKE2b-256 ff81cfbbf3d20ef55123c7a14e3645523509f7d01915c693d9bd7fc05eca27ef

See more details on using hashes here.

File details

Details for the file depyinstaller-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: depyinstaller-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for depyinstaller-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2b9729379279a56ee21ad0441716d28139b90f2542d05c4d2b2eae0faf382bf
MD5 38d27e055739b55f57fd3e5e1dbff8fb
BLAKE2b-256 8d89102ad6e4aa14a907845821780dfa2809782da3e0031c893ffe61b7ef6b7f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page