首页 > 解决方案 > macOS Catalina 10.15.5 上 psycopg2 的困难

问题描述

我有一个完成的简单 django 博客应用程序,我正在部署到 heroku。

我现在有一个实时应用程序,但我的静态 css 文件不包括在内。我认为我已经在我的 settings.py 文件中确定了(部分)问题,其中 django_heroku 无法导入。

当我尝试 pip install django-heroku 时,我在 psycopg2 处出错:

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

看来我已经安装了自制软件,并且安装了最新版本的 gcc、openssl 和 xcode。

有人对我下一步可以尝试什么有任何建议吗?

标签: pythondjangoxcodeherokupsycopg2

解决方案


我过去遇到过 psycopg2 和 MacOS 的问题。您是否尝试安装预编译版本?

pip install psycopg2-binary

这通常会为我解决问题!


推荐阅读