pyclean
Remove Python compiled bytecode files
TLDR
SYNOPSIS
pyclean [options] [directory]
DESCRIPTION
pyclean removes Python compiled bytecode files (.pyc) and __pycache__ directories from a specified directory tree or Debian package. This is useful for cleaning up stale bytecode after Python version changes, reducing disk usage, or preparing clean source distributions.The tool is part of Debian's Python packaging infrastructure and can target specific packages with the -p flag or recursively clean arbitrary directories. Since Python regenerates bytecode files automatically on import, removing them has no lasting effect beyond temporarily increasing the next import time.
PARAMETERS
DIRECTORY
Directory to clean.-p PACKAGE
Clean specific package.-v
Verbose output.-q
Quiet mode.
CAVEATS
Primarily a Debian/Ubuntu utility (part of the python-minimal package). Python automatically regenerates .pyc files on next import, so removal is safe but causes a brief slowdown on first run. The `-p` flag only works with Debian packages.
HISTORY
pyclean is part of Debian's Python packaging infrastructure, designed to clean up bytecode files during package upgrades and removals.
