Skip to main content
This guide covers common issues that may arise during the installation and setup of the Definable backend development environment.

Python Environment Issues

Poetry Installation Failures

Symptoms:
  • Error messages during Poetry installation
  • command not found: poetry after installation
Solutions:
  1. Ensure Python is correctly installed:
  2. Try the alternative installation method:
  3. Add Poetry to your PATH:
Symptoms:
  • Error messages like: SolverProblemError: Unable to find a suitable version for package X
  • Dependency resolution hangs for a long time
Solutions:
  1. Update Poetry to the latest version:
  2. Clear Poetryโ€™s cache:
  3. Try installing with verbose output for more information:
  4. As a last resort, delete poetry.lock and create a fresh one:
    Only do this in a development environment, as it may change your dependency versions.
Symptoms:
  • Error like: Poetry could not find a Python executable
Solutions:
  1. Explicitly set Python version for your project:
  2. Verify that the correct Python version is installed and available:
  3. If using pyenv, ensure itโ€™s properly initialized:

Virtual Environment Problems

Symptoms:
  • command not found: activate or similar errors
  • Virtual environment does not activate correctly
Solutions:
  1. Verify your shell and use the correct activation command: Bash/Zsh (Linux/macOS):
    Windows Command Prompt:
    Windows PowerShell:
  2. If PowerShell has execution policy issues:
  3. Recreate the virtual environment if necessary:
Symptoms:
  • ModuleNotFoundError: No module named 'X' despite successful installation
Solutions:
  1. Verify the package is installed:
  2. Ensure youโ€™re using the correct Python environment:
  3. Try reinstalling the specific package:
  4. Check for Python path issues:

PostgreSQL Issues

Symptoms:
  • Unable to install PostgreSQL
  • PostgreSQL service wonโ€™t start
Solutions:
  1. For Windows users:
    • Use the official PostgreSQL installer from postgresql.org
    • Ensure the service is running: Services.msc > Find PostgreSQL service > Start
  2. For macOS users:
  3. For Linux users:
  4. As an alternative, use Docker:
Symptoms:
  • could not connect to server: Connection refused
  • psql: error: FATAL: role "postgres" does not exist
Solutions:
  1. Verify PostgreSQL is running:
  2. Create the missing user if needed:
  3. Check and update PostgreSQL authentication settings:
    • Edit pg_hba.conf (location varies by system)
    • Change authentication method from peer to md5 or trust for local connections (for development only)
  4. For Docker, check container status:
Symptoms:
  • ERROR: could not open extension control file "pgvector"
  • Migration fails with pgvector-related errors
Solutions:
  1. Install the pgvector extension:
  2. For Docker, use a container with pgvector pre-installed:
  3. Create the extension in your database:
  4. If using Supabase, enable the extension through the dashboard:
    • Go to Supabase dashboard > Database > Extensions
    • Find and enable the vector extension

Pre-commit Hook Issues

Symptoms:
  • pre-commit: command not found
  • Pre-commit hooks donโ€™t run when committing
Solutions:
  1. Install pre-commit globally:
  2. Install the git hooks:
  3. Update to the latest hooks:
  4. Run the hooks manually to verify they work:
Symptoms:
  • Commit blocked with error messages from ruff, mypy, or other checks
  • Hooks taking too long to run
Solutions:
  1. Fix the specific issues reported by the checks:
    • For ruff issues: ruff check --fix
    • For mypy issues: Fix type annotations according to errors
  2. If hooks are too slow, run selectively:
  3. Temporarily skip hooks if needed (not recommended for regular use):
  4. Check configuration files for issues:
    • .pre-commit-config.yaml - Hook settings
    • ruff.toml - Ruff linter configuration
    • mypy.ini - MyPy configuration

Docker Issues

Symptoms:
  • Unable to install Docker
  • Docker commands not found
Solutions:
  1. Follow the official installation guides:
  2. For Windows, ensure WSL2 is installed and configured:
  3. Verify installation:
Symptoms:
  • docker-compose: command not found
  • Issues with compose.yml configuration
Solutions:
  1. Install Docker Compose:
  2. Verify your compose.yml:
  3. Common formatting issues:
    • Indentation errors in YAML
    • Missing quotes around values with special characters
    • Environment variables not properly set
Symptoms:
  • docker compose up --build fails with errors
  • Issues with the Dockerfile
Solutions:
  1. Check Dockerfile for errors:
    • Verify paths and commands
    • Ensure base image exists
  2. Check for network issues:
  3. Build with verbose output for more information:
  4. Clean up Docker environment:

Configuration Issues

Symptoms:
  • Application fails to start with configuration errors
  • Missing environment variables
Solutions:
  1. Ensure .env file exists and has correct format:
  2. Check for common formatting issues:
    • No spaces around equals sign: KEY=value (correct) vs KEY = value (incorrect)
    • No quotes around values unless needed for escaping
    • Line endings (Windows vs Unix)
  3. Verify all required variables are set:
    • Check settings.py for required variables
    • Compare with .env.local template
  4. Test environment loading:
Symptoms:
  • Migration commands fail
  • alembic.ini not found or incorrect
Solutions:
  1. Create alembic.ini from template:
  2. Update the database URL:
    • Edit sqlalchemy.url in alembic.ini
    • Remember to escape % characters as %%
  3. Check alembic directory structure:
  4. Recreate alembic setup if necessary:

System-Specific Issues

Windows-Specific Issues

Symptoms:
  • Errors about path too long
  • Files not found in deeply nested directories
Solutions:
  1. Enable long paths in Windows:
  2. Use shorter paths for your project:
    • Install in C:\Dev instead of deeply nested directories
    • Use shorter folder names
  3. Enable Git long paths:
Symptoms:
  • Git shows files as changed when you didnโ€™t modify them
  • Scripts fail with syntax errors
Solutions:
  1. Configure Git to handle line endings correctly:
  2. Add a .gitattributes file to your project:
  3. Fix existing files:

macOS-Specific Issues

Symptoms:
  • Permission denied errors when running scripts
  • Unable to write to directories
Solutions:
  1. Fix script permissions:
  2. Check folder ownership:
  3. For Homebrew issues:
Symptoms:
  • โ€œApp cannot be opened because the developer cannot be verifiedโ€
Solutions:
  1. Open application while bypassing Gatekeeper:
    • Right-click the app > Open
    • When prompted, click โ€œOpenโ€ again
  2. For command-line tools:

Linux-Specific Issues

Symptoms:
  • Missing shared libraries
  • Build failures for native extensions
Solutions:
  1. Ubuntu/Debian: Install development packages:
  2. CentOS/RHEL/Fedora:
  3. For specific package errors, install the required libraries:
    • SQLAlchemy with PostgreSQL: sudo apt install libpq-dev
    • Cryptography: sudo apt install libssl-dev libffi-dev

Next Steps

If youโ€™ve resolved your installation issues, proceed to: If youโ€™re still experiencing problems, check the other troubleshooting guides or contact the development team for assistance.