Installation¶
Comprehensive installation guide for pyproc in various environments.
Prerequisites¶
| Requirement | Minimum Version | Recommended |
|---|---|---|
| Go | 1.22 | Latest stable |
| Python | 3.9 | 3.12 |
| OS | Linux/macOS | Linux (production) |
Go Installation¶
Option 1: Go Modules (Recommended)¶
Add pyproc to your go.mod:
Option 2: Specific Version¶
Option 3: Development Version¶
Verify Installation¶
Python Installation¶
Option 1: pip (Simple)¶
Option 2: Virtual Environment (Recommended)¶
# Create virtual environment
python3 -m venv venv
# Activate (Linux/macOS)
source venv/bin/activate
# Activate (Windows)
venv\Scripts\activate
# Install pyproc-worker
pip install pyproc-worker
Option 3: Poetry¶
Option 4: uv (Fast)¶
Verify Installation¶
Development Environment Setup¶
1. Clone Repository (for examples)¶
2. Install Dependencies¶
Go side:
Python side:
3. Run Examples¶
Production Environment Setup¶
Docker¶
Create Dockerfile:
# Multi-stage build
FROM golang:1.22-alpine AS go-builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -o /app/server ./cmd/server
FROM python:3.12-slim
WORKDIR /app
# Install Python dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy Go binary
COPY --from=go-builder /app/server /app/server
COPY worker.py ./
# Run
CMD ["/app/server"]
Kubernetes¶
See Kubernetes Deployment Guide for details.
Platform-Specific Notes¶
Linux¶
Ubuntu/Debian:
CentOS/RHEL:
macOS¶
Using Homebrew:
Windows¶
⚠️ Not Supported: pyproc requires Unix Domain Sockets, which are not available on Windows.
Alternatives: - Use Windows Subsystem for Linux (WSL) - Use Docker Desktop with Linux containers
Configuration¶
Environment Variables¶
# Python executable (if not in PATH)
export PYPROC_PYTHON_EXEC=/path/to/python3
# Socket path (default: /tmp/pyproc.sock)
export PYPROC_SOCKET_PATH=/var/run/pyproc.sock
# Log level
export PYPROC_LOG_LEVEL=debug
Virtual Environment¶
If using a Python virtual environment, configure Go to use it:
Troubleshooting¶
Python Not Found¶
Symptom: exec: "python3": executable file not found in $PATH
Solution:
# Find Python location
which python3
# Use absolute path in config
WorkerConfig{
PythonExec: "/usr/bin/python3",
}
Permission Denied on Socket¶
Symptom: permission denied when creating socket
Solution:
# Use user-writable directory
mkdir -p ~/tmp
chmod 755 ~/tmp
# Configure socket path
SocketPath: os.Getenv("HOME") + "/tmp/pyproc.sock"
Module Not Found¶
Symptom: ModuleNotFoundError: No module named 'pyproc_worker'
Solution:
# Verify installation
pip list | grep pyproc-worker
# Reinstall if missing
pip install --upgrade pyproc-worker
Next Steps¶
Now that pyproc is installed:
- Quick Start: Get pyproc running in 5 minutes
- First Integration: Build a real integration
- Type-Safe API: Learn type-safe calling