[Python] CommandError: You appear not to have the 'psql' program installed or on your path

Discussão em 'Python' iniciado por Stack, Maio 7, 2025.

  1. Stack

    Stack Membro Participativo

    I'm using Windows, no virtualenv. I have psycopg2 installed with Pip, and the latest version of PostgreSQL installed as well.

    When I run ./ manage.py dbshell, I get the following error:

    CommandError: You appear not to have the 'psql' program installed or on your path.


    When I run ./ manage.py dbshell psql, I get this:

    usage: manage.py dbshell [-h] [--version] [-v {0,1,2,3}] [--settings SETTINGS]
    [--pythonpath PYTHONPATH] [--traceback] [--no-color]
    [--database DATABASE]
    manage.py dbshell: error: unrecognized arguments: psql


    I have read a few other posts on this error like this but I don't understand why this is not working for me. I have all the settings properly configured, and all the proper apps installed.

    My settings.py:

    DATABASES = {
    'default': {
    'ENGINE': 'django.db.backends.postgresql',
    'NAME': 'postgres',
    'USER': 'postgres',
    'PASSWORD': '********',
    'HOST': '127.0.0.1',
    'PORT': '5432',
    }
    }


    EDIT: I did not add Postgres's /bin folder into my PATH. I just did it and it is working now. Thanks to Daniel Roseman.

    Continue reading...

Compartilhe esta Página