Python environment cleanup tool for macOS.
PyReseter cleans up Python-related cache files and packages to free disk space and resolve environment conflicts.
Two modes available:
- Cache cleanup - Removes cache files only, keeps installed packages
- Full reset - Removes user-installed packages + cache files (with backup)
# Download and run
curl -O https://raw.githubusercontent.com/your-username/pyreseter/main/pyreseter.sh
chmod +x pyreseter.sh
./pyreseter.sh./pyreseter.sh./pyreseter.sh -c # Cache cleanup only
./pyreseter.sh -f # Full reset (packages + cache)
./pyreseter.sh -p # Preview mode (safe)
./pyreseter.sh -h # Help| Type | Content |
|---|---|
| pip cache | ~/Library/Caches/pip |
| Poetry cache | ~/Library/Caches/pypoetry |
| Conda cache | Package cache + temp files |
| Bytecode | __pycache__, .pyc, .pyo files |
| Test cache | pytest, coverage, htmlcov |
| Jupyter | Checkpoints, signatures |
| Dev tools | mypy, pylint, tox cache |
- Smart protection - Never removes system packages (pip, setuptools, wheel)
- Automatic backup - Package lists saved to
~/.python_reset_backup/ - Preview mode - See what will be cleaned before running
- Recovery - Restore packages with one command
Full reset automatically backs up your packages:
# View backups
ls ~/.python_reset_backup/
# Restore packages
pip install -r ~/.python_reset_backup/20241201_221500/pip_packages.txt- macOS 10.14+
- Bash or Zsh
- Python (any version)
| Option | Description |
|---|---|
-h, --help |
Show help |
-v, --version |
Show version |
-p, --preview |
Preview only |
-c, --cache-only |
Cache cleanup mode |
-f, --full-reset |
Full reset mode |
-q, --quiet |
Quiet mode |
--no-backup |
Skip backup (full reset only) |
Typical space savings:
- pip cache: 500MB - 2GB+
- Package files: Varies by usage
- Bytecode files: 10-100MB
- Other cache: 50-200MB
Permission denied:
chmod +x pyreseter.shCan't clean some files: Normal - files may be in use or protected.
Python broken after reset:
pip install --upgrade pip setuptools wheelMIT License - see LICENSE file.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Issues and suggestions welcome.