LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pyclean

Remove Python compiled bytecode files

TLDR

Remove bytecode files
$ pyclean [directory]
copy
Clean current directory
$ pyclean .
copy
Clean package
$ pyclean -p [package_name]
copy
Verbose output
$ pyclean -v [directory]
copy

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.

SEE ALSO

python(1), py3clean(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid