django-heroku安装出现错误

时间:2019-07-09 20:56:07

标签: python django heroku

我正在尝试将我的应用程序部署到heroku,但是执行 pip install django-heroku 后,出现错误。我在Mac上使用Django 2.2运行Python 3。

错误消息建议我安装 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/

2 个答案:

答案 0 :(得分:0)

安装此软件包对我来说是'libpqxx'(或从here引用的这个'libpq-dev')!

注意:即时通讯使用的是Linux,因此您可能会有所不同

答案 1 :(得分:0)

尝试:

sudo apt install libpq-dev

然后运行pip install django-heroku。应该可以。