0

I have to run a docker compose but im getting a psycop2 error, which im not able to resolve. when running docker-compose, i get a message that my build failed:

#8 36.63 ERROR: No matching distribution found for psycopg2-binary==2.8.6
executor failed running [/bin/sh -c pip3 install  -r requirements.txt]: exit code: 1
ERROR: Service 'worker' failed to build : Build failed     

the reason appears to be that i dont have pg-config executable in place:

Error: pg_config executable not found.
pg_config is required to build psycopg2 from source.  Please add the directory
containing pg_config to the $PATH or specify the full executable path with the option: python setup.py build_ext --pg-config 
/path/to/pg_config build or with the pg_config option in 'setup.cfg'

one fix tried was to add the binary with pip, but when i just run pip install or directly install the requirements.txt, it says requirement is already satisfied :

Requirement already satisfied: psycopg2-binary==2.8.6 in ./env2/lib/python3.9/site-packages (from -r requirements.txt (line 17)) (2.8.6)

any help is appreciated. running on mac 2020 m1

neutrino
  • 848
  • 7
  • 16
  • If you're using this path, you need to use the base Linux distribution's package manager (usually `apk` or `apt-get`) to install the C PostgreSQL development files; it's not something you can install using `pip`. – David Maze Jan 03 '22 at 22:38

0 Answers0