【问题标题】:installation psycopg2 on MAC with error: pg_config executable not found在 MAC 上安装 psycopg2 时出现错误:找不到 pg_config 可执行文件
【发布时间】:2020-05-20 15:37:03
【问题描述】:

在 MAC 上安装 psycopg2 需要您的帮助。

  1. 我已经安装了:
  2. 当我尝试安装 psycopg2 包时,终端显示错误
    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'.

我读过很多文章,他们建议在安装psycopg2 之前提供$PATH,但问题在于Postgres.app 没有创建pg_config 目录:

/Users/konstantin_klychkov/Library/Application Support/Postgres/var-12

【问题讨论】:

标签: postgresql macos psycopg2


【解决方案1】:

问题在于 Postgres.app 没有创建 pg_config 目录: /Users/konstantin_klychkov/Library/Application Support/Postgres/var-12

我想你可能找错地方了。 pg_config 不是目录,而是程序。尝试将/Applications/Postgres.app/Contents/Versions/12/bin 放入您的$PATH

$ ls /Applications/Postgres.app/Contents/Versions/12/bin | grep pg_config
pg_config

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-06-04
    • 2018-03-24
    • 2021-02-14
    • 1970-01-01
    • 2013-12-08
    相关资源
    最近更新 更多