Make pip install just work. No sudo, no activation, no ceremony.
A two-tier Python package architecture that gives you:
- System venv (
/opt/system-python/) - Root-locked, for OS components only - User venv (
~/.local/python-packages/) - Your personal packages, no sudo needed
Core principle: When you run pip install, it should "just work" and go to your personal venv. Zero friction.
- Zero-friction installs -
pip installautomatically goes to your user venv - Automatic snapshots - Every install/uninstall is tracked
- Easy undo - Roll back mistakes with
sysvenv undo - Named snapshots - Save and restore package sets
- Complete isolation - User packages can't break system
- Composable - Works alongside project-local venvs
# Clone and install
git clone <repo-url>
cd sysvenv
./install.shThis will:
- Install
sysvenvto~/.local/bin - Initialize your user venv
- Add PATH to your shell config
source ~/.bashrc # or ~/.zshrcsysvenv status# Just install packages like normal
pip install requests black pytest
# See what changed
sysvenv diff
# View history
sysvenv history
# Undo last install
sysvenv undosysvenv init- Initialize user venv (done by installer)sysvenv status- Show current statussysvenv doctor [--fix]- Health check and repair
sysvenv history [--limit N]- Show operation historysysvenv diff [N]- Show changes from operation N (default: last)sysvenv undo [N]- Rollback last N operations (default: 1)
sysvenv snapshot <name>- Save current package setsysvenv restore <name>- Restore named snapshotsysvenv list-snapshots- List available snapshots
sysvenv clean- Nuke and recreate venvsysvenv clean --keep-baseline- Restore to initial state
Project venv (if activated) ← Highest priority
↓
User venv (~/.local/python-packages/venv)
↓
System venv (/opt/system-python/venv) ← System services only
When you type python3 or pip, your shell finds the first one in PATH.
After installation, your ~/.bashrc has:
export PATH="$HOME/.local/python-packages/venv/bin:$PATH"This makes your user venv's Python and pip take precedence.
System administrators can install system-wide:
sudo ./install.sh --systemThis installs:
sysvenvto/usr/local/bin/- pip wrapper to
/usr/local/bin/pip - Optionally creates
/opt/system-python/venv
pip install requests black pytest
# Automatically snapshotted, shows diffpip install some-bad-package
# Oh no, this broke things!
sysvenv undo
# Back to previous state# Install your tools
pip install pytest black mypy ruff httpie
# Save it
sysvenv snapshot dev-tools
# Later, after messing around...
sysvenv restore dev-tools
# Back to your saved state# ML work
sysvenv restore ml-stack # numpy, pandas, scikit-learn, etc.
# Web dev work
sysvenv restore webdev # flask, requests, etc.sysvenv clean
# Venv deleted and recreated, empty slateThis doesn't replace project-local venvs. They work exactly as before:
# Create project venv
python3 -m venv myproject/venv
# Activate it
source myproject/venv/bin/activate
# Now pip uses project venv (highest priority in PATH)
pip install -r requirements.txtWhen you deactivate, you're back to your user venv.
~/.local/python-packages/
├── venv/ # Your Python packages
├── history/ # Automatic snapshots
│ ├── 001_before.json
│ ├── 001_after.json
│ └── ...
├── snapshots/ # Named snapshots
│ ├── baseline.txt
│ ├── dev-tools.txt
│ └── ...
└── config.toml # Configuration
Edit ~/.local/python-packages/config.toml:
[history]
max_entries = 100 # Keep last 100 operations
auto_snapshot = true # Snapshot before installs
show_diff_after_install = true # Show diff after install
[snapshots]
auto_baseline = true # Create baseline on init
[ui]
color = true
verbose = falseYour PATH doesn't include ~/.local/bin. Add to ~/.bashrc:
export PATH="$HOME/.local/bin:$PATH"Then: source ~/.bashrc
You're using the system pip. Make sure:
- User venv is initialized:
sysvenv status - User venv is in PATH:
which pipshould show~/.local/python-packages/venv/bin/pip
# Use full path to bypass user venv
/usr/bin/python3Or remove user venv from PATH temporarily:
export PATH=${PATH#*:} # Remove first entry (user venv)# Remove tools
rm ~/.local/bin/sysvenv
# Remove user venv
rm -rf ~/.local/python-packages
# Remove PATH line from ~/.bashrc
# (edit manually)"The right defaults should be invisible. Users should never think about where their packages go. They should just go to the right place."
This is not a security tool. This is not a production tool. This is a tool to make Python packaging suck less for everyday development.
- NORTHSTAR2.md - Full vision and architecture
sysvenv --help- Command helpsysvenv <command> --help- Command-specific help
MIT