python - 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。
有人对我下一步可以尝试什么有任何建议吗?
解决方案
我过去遇到过 psycopg2 和 MacOS 的问题。您是否尝试安装预编译版本?
pip install psycopg2-binary
这通常会为我解决问题!
推荐阅读
- laravel - 预订和管理
- c# - 尝试在多个方法中使用一个字段,并且在我的字段似乎没有被使用后发生运行时错误
- json - 如何将设置附加到 Visual Studio Code 中的默认值?
- ruby-on-rails - 错误:列“pitch_count”在别名中存在时不存在
- wordpress - Laravel Forge - 部署 Wordpress + HTTPS 会导致“重定向过多”
- c - RegEnumKey 总是返回错误 ERROR_MORE_DATA
- javascript - 使用 Jest,如何仅在测试用例失败时触发断点?
- python - 从 API 中提取 XML 并使用 Python 保存到 SQL 数据库
- postgresql - 是否可以使用 Postgresql 的 file_fdw 外部数据包装器来读取网络共享上的文件?
- reactjs - Highcharts - TypeError:无法读取 null 的属性“isResponsiveOptions”