[Django]-Error: pg_config executable not found. even though I have added the path to pg_config on environment variable

2👍

The problem was that the environment variable PATH was not set properly. It is used to find executables that are not in the current directory.

For your purposes you don’t have to change the PATH permanently:

  • Open the command line (DOS box) with cmd.exe.

  • Look at the current settings with PATH.

  • Change the value for the current session with

    SET PATH="C:\Program Files\PostgreSQL\12\bin";%PATH%
    

Now it should work.

There is a way to set environment variables permanently on Windows, but they hide it better from version to version. A web search will usually help.

Leave a comment