首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >用错误在MAC上安装psycopg2 :未找到pg_config可执行文件

用错误在MAC上安装psycopg2 :未找到pg_config可执行文件
EN

Stack Overflow用户
提问于 2020-02-04 18:38:47
回答 1查看 1.6K关注 0票数 0

我需要你的帮助,安装psycopg2上的MAC。

我已经安装的

Anaconda environment

  • Postgres.app的一部分

  1. 当我试图安装psycopg2包时,终端显示了一个错误

代码语言:javascript
运行
复制
    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'.

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

/Users/konstantin_klychkov/Library/Application支持/Postgres/var-12

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-02-05 07:16:22

问题在于/Users/konstantin_klychkov/Library/Application

/Postgres/var-12 Postgres.app没有创建pg_config目录

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

代码语言:javascript
运行
复制
$ ls /Applications/Postgres.app/Contents/Versions/12/bin | grep pg_config
pg_config
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60063650

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档