【发布时间】:2020-05-20 15:37:03
【问题描述】:
在 MAC 上安装 psycopg2 需要您的帮助。
- 我已经安装了:
- Python 3.7.3 作为 Anaconda 环境的一部分
- Postgres.app 来自https://postgresapp.com
- 当我尝试安装 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
【问题讨论】:
-
为什么不使用 anaconda 包? anaconda.org/anaconda/psycopg2
标签: postgresql macos psycopg2