pyc-wheel
raw JSON → 2.3.0 verified Fri May 01 auth: no python
A tool to compile all .py files inside a wheel to .pyc files, optimizing startup time. Current version 2.3.0, supports Python >=3.10,<4.0.0. Maintenance release cadence appears irregular.
pip install pyc-wheel Common errors
error ModuleNotFoundError: No module named 'pyc-wheel' ↓
cause Mistaking the pip package name for the Python module name; 'pyc-wheel' is not importable.
fix
Use 'from pyc_wheel import main' (underscore) instead.
error ERROR: pyc-wheel requires Python >=3.10,<4.0.0 but you have Python 3.9. ↓
cause Python version too old. pyc-wheel drops support for Python <3.10 as of version 2.0.0.
fix
Upgrade Python to 3.10 or higher, or use an older version of pyc-wheel (pip install 'pyc-wheel<2').
Warnings
gotcha The package name on PyPI is 'pyc-wheel' (with hyphen), but the importable module is 'pyc_wheel' (with underscore). This mismatch is a common source of ImportError. ↓
fix Use 'pip install pyc-wheel' and 'from pyc_wheel import main'.
gotcha pyc-wheel only works with wheel files, not directories. You must first build a wheel from your project (e.g., 'pip wheel .') before running pyc-wheel. ↓
fix Run 'pip wheel . --no-deps -w dist' then 'pyc-wheel dist/*.whl'.
deprecated The CLI flag '--inplace' modifies the original wheel file. This may be deprecated in future; prefer outputting to a new file with '--output-dir'. ↓
fix Use 'pyc-wheel input.whl -o output.whl' or '--output-dir'.
Imports
- main wrong
import pyc_wheelcorrectfrom pyc_wheel import main
Quickstart
from pyc_wheel import main
# Compile a wheel in-place
# main() expects sys.argv style list or uses sys.argv
# example: main(['pyc-wheel', '--inplace', 'path/to/wheel.whl'])