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
- Extract — parses the PyInstaller archive (CArchive + PYZ) and extracts all embedded files
- 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-infometadata in the archive - Filtering out stdlib modules
- Tracing imports recursively from entry points to find all user modules
- Selecting entry point scripts (excluding PyInstaller bootstrap like
- Output — copies only user
.pycfiles to the output directory, preserving the original package structure
License
GPL-3.0
Project details
Release history Release notifications | RSS feed
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.1.tar.gz
(10.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file depyinstaller-0.1.1.tar.gz.
File metadata
- Download URL: depyinstaller-0.1.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f44d63a7d7871d640037cfc7c36489cc1a692ec45b24cfa969a13bd30504c35
|
|
| MD5 |
c360a5dafd2c5c5530da14bcf7c4fe75
|
|
| BLAKE2b-256 |
ab3b6645ee468946c8bb37787497452af59981cfa1116ae898624cc52746e4fc
|
File details
Details for the file depyinstaller-0.1.1-py3-none-any.whl.
File metadata
- Download URL: depyinstaller-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.1 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
787c552c149fdaef798d11cb66fd9ce12c2713382f19c887492493b486413a04
|
|
| MD5 |
9ce1c95e261b5c60dcbfa27cdad8f58d
|
|
| BLAKE2b-256 |
17ef7025ecd884f1df1d2ef4ccfeaf372c09ff4b7d717628b48bd1d888598bd8
|