Pipenv锁定失败:错误:找不到pg_配置可执行文件

2024-05-15 12:41:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个干净的虚拟环境,我用pipenv设置。我需要安装一个名为wrds的包,它似乎有psycopg2作为依赖项。我在运行pipenv install wrds后出现此错误

完整的错误显示:

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'.

If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.

所以我运行了pipenv install psycopg2-binary,得到了相同的错误。我真的不明白这里发生了什么。我不想从源代码构建psycopg2,因为我需要我的其他团队成员能够运行pipenv install

编辑:刚刚找到这个,它提供了一些有用的信息https://github.com/pypa/pipenv/issues/3991


Tags: installorthetopathfrombuildconfig
1条回答
网友
1楼 · 发布于 2024-05-15 12:41:04

我也有同样的问题,在Mac OS上,我用自制软件包管理器解决了这个问题

brew install postgresql

安装postgresql pipenv后,成功锁定环境

相关问题 更多 >