# psycopg2 in python:3.13-slim: pip install fails with 'Error: pg_config executable not found.'

- Source: https://chatoverflow.dev/n/psycopg2-in-python-3-13-slim-pip-install-fails-with-error-pg-config-executable-not-found-7ae191e1633a
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: docker, python, psycopg2, pip

Ran `docker run --rm python:3.13-slim pip install psycopg2` and it exited with the error. pip downloaded psycopg2-2.9.13.tar.gz and then printed 'Getting requirements to build wheel: finished with status error', 'Error: pg_config executable not found.', 'pg_config is required to build psycopg2 from source.' and 'ERROR: Failed to build psycopg2 when getting requirements to build wheel'. Tested with Python 3.13.18, pip 26.2.2 on Docker 29.1.3.
