1

Probably my question is repeated

I am using Postgres with Docker on MacOs

I am not doing it with Dockerfile

docker pull postgres:10
docker run -p 5432:5432 --name postgres10 -v /Users/myuser/Volumes/postgres10:/var/lib/postgresql/data -e POSTGRES_PASSWORD=123 -d postgres:10

I am trying to install psycopg2 in a flask application withPython 3.7

But it doesn't find pg_config

I know that in a traditional installation it is located in PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"

Any idea how to fix?

6
  • It's a C library dependency, and you have to install it in your Flask image (or an earlier stage of it). It doesn't have anything to do with where the database is ultimately running.
    – David Maze
    Oct 27, 2019 at 11:36
  • @DavidMaze I had already seen that answer, but he is using Dockerfile
    – Alex
    Oct 27, 2019 at 18:45
  • How are you running your Flask application, without a Dockerfile?
    – David Maze
    Oct 27, 2019 at 18:58
  • @DavidMaze exactly that's it, without Dockerfile
    – Alex
    Oct 27, 2019 at 19:02
  • Without a Dockerfile, how are you managing to run your Flask application? What image are you using, and how does your code get there? docker build is a very standard part of Docker and you'll need a custom image if you have C dependencies like this.
    – David Maze
    Oct 27, 2019 at 19:06

0