python - django-heroku 安装报错
问题描述
我正在尝试将我的应用程序部署到 heroku,但在执行pip install django-heroku后它给了我一个错误。我在 Mac 上运行 Python 3 和 Django 2.2。
错误消息建议安装psycopg2-binary,我这样做了,但安装后我仍然看到相同的错误。谢谢你的帮助。
错误信息:
ERROR: Complete output from command python setup.py egg_info:
ERROR: running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
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.
For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/6z/cqmvjcds4_s2pz_8zb28s_v40000gn/T/pip-install-28adny1a/psycopg2/
解决方案
尝试:
sudo apt install libpq-dev
然后运行pip install django-heroku
。它应该工作。
推荐阅读
- google-chrome - Flutter URL 创建并打开一个新的 google drive 文件夹
- swift - Swift 包管理器 - 项目中无法识别协议
- java - 尝试使用最大堆的逻辑来实现最小堆
- java - 用于 4 眼检查的休眠锁定对象
- c# - 在 travis-ci 中找不到 msbuild 命令
- python - 该程序不会在某些图形对象中注册点击,但会在其他图形对象中注册。我在这里想念什么?
- arrays - 如何添加从一组中选择一个元组的约束?
- ruby-on-rails - iphone/ipad Rails 上的一个字段中的表单字段变为灰色
- java - 使用 JackSon 删除 JSONArray 中的某些数组
- gis - 如何将经度和纬度数据转换为 NetLogo 的 shapefile