首页 > 解决方案 > 将 psycopg2-binary 与 pip install -r requirements.txt 一起使用

问题描述

我在 M1 Mac (11.2.3) 上运行 Python 3.9。我无法安装 psycopg2,但能够 pip install psycopg2-binary。但是,当我尝试通过 pip install -r requirements.txt 安装所有项目依赖项时,我仍然收到以以下结尾的 psycopg2 错误:

ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/gcc' failed with exit code 1

错误之前的命令是:

Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py) ... error

我已经尝试了在安装 psycopg2 时可以找到的每个 google / stackoverflow 答案,但没有一个成功。任何有关安装 psycopg2 或让我的其他依赖项与 psycopg2-binary 一起工作的提示将不胜感激。让我知道更多错误输出是否会有所帮助。

标签: psycopg2

解决方案


推荐阅读