Skip to content

Latest commit

 

History

History
161 lines (113 loc) · 3.33 KB

File metadata and controls

161 lines (113 loc) · 3.33 KB

Installation Guide

Detailed installation instructions for OpenCanvas.

System Requirements

  • Python 3.8 or higher
  • pip package manager
  • Chrome/Chromium browser (for PDF conversion)
  • Git (optional, for development)

Installation Options

Option 1: Quick Install (Recommended)

Install the package directly with CLI support:

git clone https://github.com/genmini-ai/OpenCanvas.git
cd OpenCanvas
pip install -e .

Option 2: Complete Installation (CLI + API)

For full functionality including the REST API:

pip install -r requirements-all.txt

Option 3: Core Only

For basic CLI functionality without API dependencies:

pip install -r requirements.txt

Option 4: API Only

For microservices deployment:

pip install -r requirements-api.txt

Browser Automation Setup

OpenCanvas requires browser automation for HTML-to-PDF conversion.

Playwright (Recommended)

playwright install chromium

Selenium

Download ChromeDriver from https://chromedriver.chromium.org/ and add to your PATH.

Environment Configuration

  1. Copy the example environment file:

    cp .env.example .env
  2. Edit .env with your API keys:

    # Required
    ANTHROPIC_API_KEY=your_anthropic_api_key_here
    
    # Optional but recommended
    BRAVE_API_KEY=your_brave_api_key_here
    GEMINI_API_KEY=your_gemini_api_key_here
    OPENAI_API_KEY=your_openai_api_key_here
  3. Configure evaluation provider (optional):

    EVALUATION_PROVIDER=gemini  # or claude, gpt
    EVALUATION_MODEL=gemini-2.5-flash

Get API Keys

Anthropic (Required)

  1. Visit https://console.anthropic.com/
  2. Create an account or sign in
  3. Navigate to API Keys
  4. Generate a new key

Brave Search (Optional)

  1. Visit https://api.search.brave.com/app/keys
  2. Sign up for free tier
  3. Generate an API key

Gemini (Optional - for evaluation)

  1. Visit https://aistudio.google.com/
  2. Sign in with Google account
  3. Get API key from settings

OpenAI (Optional - for evaluation)

  1. Visit https://platform.openai.com/api-keys
  2. Create an account or sign in
  3. Generate a new API key

Verify Installation

Test your setup:

# Check configuration
python -c "from opencanvas.config import Config; Config.validate(); print('✅ Configuration valid')"

# Generate a test presentation
opencanvas generate "test topic" --output-dir test_output

# Check if CLI is installed
opencanvas --help

Troubleshooting

"opencanvas command not found"

Make sure you installed with the -e flag:

pip install -e .

Check if it's in your PATH:

which opencanvas

"ANTHROPIC_API_KEY is required"

Ensure your .env file exists in the directory where you run opencanvas:

cat .env | grep ANTHROPIC_API_KEY

"Playwright not available"

Install Chromium browser for Playwright:

playwright install chromium

Or use Selenium as fallback:

opencanvas convert slides.html --method selenium

Next Steps