Skip to main content

Prerequisites

Before installing Scribe Backend, ensure you have:
  • Python 3.13+ installed on your system
  • Git for cloning the repository
  • PostgreSQL or a Supabase account
  • Redis 5.0+ for Celery task queue
Scribe Backend requires Python 3.13 or higher. Check your version with python3 --version.

Step 1: Clone Repository

Clone the Scribe Backend repository to your local machine:
git clone <repository-url>
cd pythonserver

Step 2: Create Virtual Environment

Create an isolated Python environment to manage dependencies:
1

Create venv

python3.13 -m venv venv
This creates a venv/ directory containing the isolated Python installation.
2

Activate virtual environment

source venv/bin/activate
Your terminal prompt should now show (venv) indicating the environment is active.
3

Verify activation

which python
# Should output: /path/to/pythonserver/venv/bin/python
Always activate the virtual environment before running any Python commands or installing packages.

Step 3: Install Python Dependencies

Install all required Python packages from requirements.txt:
pip install -r requirements.txt

Key Dependencies Installed

PackageVersionPurpose
fastapi0.109+Web framework and API server
sqlalchemy2.0.25+ORM for database operations
alembic1.13.1+Database migration management
celery5.3+Distributed task queue
redis5.0+Celery broker and result backend
anthropic0.72.1+Claude AI integration
pydantic-ai-slim1.18+Structured AI agents
playwright1.56+Web scraping (headless browser)
supabase2.3+Authentication and database client
logfire4.14.2+Observability and monitoring
Installation may take 2-5 minutes depending on your internet connection. The complete dependency list includes ~50 packages.

Step 4: Install Playwright Browsers

Scribe uses Playwright for web scraping with JavaScript support. Install the Chromium browser:
playwright install chromium
Large download: Playwright browsers are approximately 300MB. Ensure you have sufficient disk space.

Verify Playwright Installation

Check that Chromium was installed successfully:
playwright --version
# Expected output: Version 1.56.0 or higher

Troubleshooting Playwright

If you see errors about missing executables:
# Reinstall with system dependencies
playwright install --with-deps chromium
On Linux, you may need additional system libraries:
sudo apt-get install -y libglib2.0-0 libnss3 libnspr4 libdbus-1-3 libatk1.0-0
For Docker or serverless deployments, use the --no-sandbox flag (already configured in the codebase):
# Already configured in web_scraper step
browser = await playwright.chromium.launch(
    headless=True,
    args=['--no-sandbox', '--disable-setuid-sandbox']
)

Step 5: Verify Installation

Confirm all dependencies are installed correctly:
# Check Python version
python --version
# Expected: Python 3.13.x

# Check key packages
python -c "import fastapi; print('FastAPI:', fastapi.__version__)"
python -c "import sqlalchemy; print('SQLAlchemy:', sqlalchemy.__version__)"
python -c "import celery; print('Celery:', celery.__version__)"
python -c "from playwright.sync_api import sync_playwright; print('Playwright: OK')"

Expected Output

FastAPI: 0.109.0
SQLAlchemy: 2.0.25
Celery: 5.3.0
Playwright: OK

Next Steps

Now that installation is complete:
  1. Configure environment variablesConfiguration Guide
  2. Set up the databaseDatabase Setup Guide
  3. Run the application locallyRunning Locally Guide

Common Issues

Install pip or use python -m pip instead:
python -m pip install -r requirements.txt
Don’t use sudo with pip in a virtual environment. Ensure you’ve activated the venv:
source venv/bin/activate
pip install -r requirements.txt
Install Python 3.13 using your system’s package manager:macOS (Homebrew):
brew install [email protected]
Ubuntu/Debian:
sudo apt update
sudo apt install python3.13 python3.13-venv
Use a faster mirror or upgrade pip:
pip install --upgrade pip
pip install -r requirements.txt --prefer-binary

Updating Dependencies

To update packages to the latest compatible versions:
# Activate virtual environment first
source venv/bin/activate

# Upgrade all packages
pip install --upgrade -r requirements.txt

# Reinstall Playwright browsers if needed
playwright install chromium
Test thoroughly after updating dependencies, as major version changes may introduce breaking changes.

Build docs developers (and LLMs) love