【发布时间】:2021-12-28 17:23:00
【问题描述】:
我正在尝试将psycopg2-binary 安装到我的 Django 项目中。我正在使用虚拟环境,我正在运行的命令是
pip install psycopg2-binary
但是,我收到大量错误消息,其要点是:
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'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
但是,嘿,我正在安装 'psycopg2-binary'
为什么我会弄得这么乱?
【问题讨论】:
-
平台/处理器架构?操作系统? Python版本? Python 是 32 位还是 64 位? (请注意,在 64 位操作系统上运行 32 位 Python 是可能的。)
-
macOS、M1、Python 3.8,不知道如何判断是 32 位还是 64 位
-
我现在从 python.org 安装了 Python 3.10,它是 64 位的。尝试再次安装 psycopg2-binary,结果相同。