types-pyinstaller
raw JSON → 6.19.0.20260408 verified Mon Apr 27 auth: no python
Typing stubs for PyInstaller, providing type hints for PyInstaller modules. Version 6.19.0.20260408, updated regularly alongside typeshed releases.
pip install types-pyinstaller Common errors
error Cannot find reference 'Analysis' in 'PyInstaller.building.api' ↓
cause IDE cannot resolve due to missing stubs or incorrect PyInstaller version.
fix
Install correct version:
pip install types-pyinstaller==6.19.0.20260408 matching your PyInstaller 6.19. error Import 'PyInstaller.__main__' could not be resolved ↓
cause Stubs not installed or Python interpreter not recognizing them.
fix
Run
pip install types-pyinstaller and ensure your IDE uses the correct interpreter. Warnings
gotcha Stubs may not cover all PyInstaller internals due to dynamic code. Rely on official PyInstaller docs for runtime behavior. ↓
fix Cross-reference with PyInstaller source; stubs are best-effort.
gotcha Do not install both `types-pyinstaller` and `pyinstaller-stubs` (or any other third-party stubs). Only one should be used. ↓
fix Uninstall conflicting packages: `pip uninstall pyinstaller-stubs`.
gotcha Stubs are often behind PyInstaller releases. Check version compatibility: types-pyinstaller version x.y.z corresponds to PyInstaller x.y. ↓
fix Match major.minor versions: e.g., use types-pyinstaller==6.* for PyInstaller 6.x.
Imports
- PyInstaller.__main__
from PyInstaller.__main__ import run - PyInstaller.building.api
from PyInstaller.building.api import Analysis, PYZ, EXE, COLLECT - PyInstaller.compat
from PyInstaller.compat import is_win, is_darwin, is_linux
Quickstart
from PyInstaller.__main__ import run
# Example: build a simple script
run(['--onefile', '--name', 'myapp', 'myapp.py'])