Documentation

sitecustomize Installation

Transparent Epochly activation using Python's sitecustomize mechanism.

How It Works

Python automatically imports sitecustomize.py from site-packages at startup. Epochly leverages this for zero-code-change activation.

Installation Methods

Automatic Installation

import epochly
epochly.install_sitecustomize()

Manual Installation

# Find site-packages location
python -c "import site; print(site.getsitepackages()[0])"
# Create sitecustomize.py
echo 'import epochly; epochly.auto_activate()' > /path/to/site-packages/sitecustomize.py

CLI Installation

epochly install-sitecustomize

Activation

Once installed, set the environment variable to enable:

export EPOCHLY_AUTO_ENABLE=1
python your_app.py # Epochly active automatically

Configuration

Configure via environment variables:

export EPOCHLY_AUTO_ENABLE=1
export EPOCHLY_LEVEL=2
export EPOCHLY_MODE=balanced
export EPOCHLY_MAX_WORKERS=8

Virtual Environments

For virtual environments, install sitecustomize after activating:

source venv/bin/activate
python -c "import epochly; epochly.install_sitecustomize()"

Uninstallation

import epochly
epochly.uninstall_sitecustomize()

Or via CLI:

epochly uninstall-sitecustomize

Verification

import epochly
if epochly.is_sitecustomize_installed():
print("sitecustomize is installed")
print(f"Location: {epochly.get_sitecustomize_path()}")
else:
print("sitecustomize not installed")

Important Notes

  • sitecustomize runs before your application code
  • Use EPOCHLY_DISABLE=1 to temporarily disable
  • Works with both system Python and virtual environments
  • Existing sitecustomize.py will be backed up before modification