我正在设置一个新的Django项目来部署在Heroku上,但是当我遵循Django Heroku部署指南时,我在"pip install Django Heroku"过程中遇到了一个错误.

我正在运行:

(env) MacBook-Pro:testing_django sudoxx2$ pip freeze
dj-database-url==0.5.0
Django==2.2.3
gunicorn==19.9.0
psycopg2-binary==2.8.3
pytz==2019.1
sqlparse==0.3.0
whitenoise==4.1.3

以下是执行pip install django-heroku命令后的错误输出:

(env) MacBook-Pro:testing_django sudoxx2$ pip install psycopg2-binary
Collecting psycopg2-binary
  Using cached https://files.pythonhosted.org/packages/ee/ed/2772267467ba5c21a73d37149da0b49a4343c6646d501dbb1450b492d40a/psycopg2_binary-2.8.3-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Installing collected packages: psycopg2-binary
Successfully installed psycopg2-binary-2.8.3
(env) MacBook-Pro:testing_django sudoxx2$ pip install django-heroku
Collecting django-heroku
  Using cached https://files.pythonhosted.org/packages/59/af/5475a876c5addd5a3494db47d9f7be93cc14d3a7603542b194572791b6c6/django_heroku-0.3.1-py2.py3-none-any.whl
Collecting psycopg2 (from django-heroku)
  Using cached https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
Requirement already satisfied: whitenoise in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django-heroku) (4.1.3)
Requirement already satisfied: django in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django-heroku) (2.2.3)
Requirement already satisfied: dj-database-url>=0.5.0 in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django-heroku) (0.5.0)
Requirement already satisfied: sqlparse in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django->django-heroku) (0.3.0)
Requirement already satisfied: pytz in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django->django-heroku) (2019.1)
Installing collected packages: psycopg2, django-heroku
  Running setup.py install for psycopg2 ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/sudoxx2/Documents/github/delete_copy/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-record-tyidyv7j/install-record.txt --single-version-externally-managed --compile --install-headers /Users/sudoxx2/Documents/github/delete_copy/env/include/site/python3.7/psycopg2
         cwd: /private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/
    Complete output (48 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.7
    creating build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_json.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/extras.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/compat.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/errorcodes.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/tz.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_range.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_ipaddress.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_lru_cache.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/extensions.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/errors.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/sql.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/pool.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    running build_ext
    building 'psycopg2._psycopg' extension
    creating build/temp.macosx-10.9-x86_64-3.7
    creating build/temp.macosx-10.9-x86_64-3.7/psycopg
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=110004 -DHAVE_LO64=1 -I/Users/sudoxx2/Documents/github/delete_copy/env/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/Cellar/postgresql/11.4/include -I/usr/local/Cellar/postgresql/11.4/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.9-x86_64-3.7/psycopg/psycopgmodule.o
    In file included from psycopg/psycopgmodule.c:27:
    In file included from ./psycopg/psycopg.h:34:
    /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h:30:10: warning: non-portable path to file '<String.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
    #include <string.h>
             ^~~~~~~~~~
             <String.h>
    In file included from psycopg/psycopgmodule.c:27:
    In file included from ./psycopg/psycopg.h:34:
    In file included from /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h:30:
    /usr/local/include/string.h:25:10: fatal error: 'plist/Node.h' file not found
    #include <plist/Node.h>
             ^~~~~~~~~~~~~~
    1 warning and 1 error generated.

    It appears you are missing some prerequisite to build the package from source.

    You may install a binary package by installing 'psycopg2-binary' from PyPI.
    If you want to install psycopg2 from source, please install the packages
    required for the build and try again.

    For further information please check the 'doc/src/install.rst' file (also at
    <http://initd.org/psycopg/docs/install.html>).

    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/sudoxx2/Documents/github/delete_copy/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-record-tyidyv7j/install-record.txt --single-version-externally-managed --compile --install-headers /Users/sudoxx2/Documents/github/delete_copy/env/include/site/python3.7/psycopg2 Check the logs for full command output.
(env) MacBook-Pro:testing_django sudoxx2$ pip install psycopg2-binary
Collecting psycopg2-binary
  Using cached https://files.pythonhosted.org/packages/ee/ed/2772267467ba5c21a73d37149da0b49a4343c6646d501dbb1450b492d40a/psycopg2_binary-2.8.3-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Installing collected packages: psycopg2-binary
Successfully installed psycopg2-binary-2.8.3
(env) MacBook-Pro:testing_django sudoxx2$ pip install django-heroku
Collecting django-heroku
  Using cached https://files.pythonhosted.org/packages/59/af/5475a876c5addd5a3494db47d9f7be93cc14d3a7603542b194572791b6c6/django_heroku-0.3.1-py2.py3-none-any.whl
Collecting psycopg2 (from django-heroku)
  Using cached https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
Requirement already satisfied: whitenoise in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django-heroku) (4.1.3)
Requirement already satisfied: django in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django-heroku) (2.2.3)
Requirement already satisfied: dj-database-url>=0.5.0 in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django-heroku) (0.5.0)
Requirement already satisfied: sqlparse in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django->django-heroku) (0.3.0)
Requirement already satisfied: pytz in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django->django-heroku) (2019.1)
Installing collected packages: psycopg2, django-heroku
  Running setup.py install for psycopg2 ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/sudoxx2/Documents/github/delete_copy/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-record-tyidyv7j/install-record.txt --single-version-externally-managed --compile --install-headers /Users/sudoxx2/Documents/github/delete_copy/env/include/site/python3.7/psycopg2
         cwd: /private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/
    Complete output (48 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.7
    creating build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_json.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/extras.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/compat.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/errorcodes.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/tz.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_range.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_ipaddress.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_lru_cache.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/extensions.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/errors.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/sql.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/pool.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    running build_ext
    building 'psycopg2._psycopg' extension
    creating build/temp.macosx-10.9-x86_64-3.7
    creating build/temp.macosx-10.9-x86_64-3.7/psycopg
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=110004 -DHAVE_LO64=1 -I/Users/sudoxx2/Documents/github/delete_copy/env/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/Cellar/postgresql/11.4/include -I/usr/local/Cellar/postgresql/11.4/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.9-x86_64-3.7/psycopg/psycopgmodule.o
    In file included from psycopg/psycopgmodule.c:27:
    In file included from ./psycopg/psycopg.h:34:
    /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h:30:10: warning: non-portable path to file '<String.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
    #include <string.h>
             ^~~~~~~~~~
             <String.h>
    In file included from psycopg/psycopgmodule.c:27:
    In file included from ./psycopg/psycopg.h:34:
    In file included from /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h:30:
    /usr/local/include/string.h:25:10: fatal error: 'plist/Node.h' file not found
    #include <plist/Node.h>
             ^~~~~~~~~~~~~~
    1 warning and 1 error generated.

    It appears you are missing some prerequisite to build the package from source.

    You may install a binary package by installing 'psycopg2-binary' from PyPI.
    If you want to install psycopg2 from source, please install the packages
    required for the build and try again.

    For further information please check the 'doc/src/install.rst' file (also at
    <http://initd.org/psycopg/docs/install.html>).

    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/sudoxx2/Documents/github/delete_copy/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-record-tyidyv7j/install-record.txt --single-version-externally-managed --compile --install-headers /Users/sudoxx2/Documents/github/delete_copy/env/include/site/python3.7/psycopg2 Check the logs for full command output.(env) MacBook-Pro:testing_django sudoxx2$ pip install psycopg2-binary
Collecting psycopg2-binary
  Using cached https://files.pythonhosted.org/packages/ee/ed/2772267467ba5c21a73d37149da0b49a4343c6646d501dbb1450b492d40a/psycopg2_binary-2.8.3-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Installing collected packages: psycopg2-binary
Successfully installed psycopg2-binary-2.8.3
(env) MacBook-Pro:testing_django sudoxx2$ pip install django-heroku
Collecting django-heroku
  Using cached https://files.pythonhosted.org/packages/59/af/5475a876c5addd5a3494db47d9f7be93cc14d3a7603542b194572791b6c6/django_heroku-0.3.1-py2.py3-none-any.whl
Collecting psycopg2 (from django-heroku)
  Using cached https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
Requirement already satisfied: whitenoise in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django-heroku) (4.1.3)
Requirement already satisfied: django in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django-heroku) (2.2.3)
Requirement already satisfied: dj-database-url>=0.5.0 in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django-heroku) (0.5.0)
Requirement already satisfied: sqlparse in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django->django-heroku) (0.3.0)
Requirement already satisfied: pytz in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django->django-heroku) (2019.1)
Installing collected packages: psycopg2, django-heroku
  Running setup.py install for psycopg2 ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/sudoxx2/Documents/github/delete_copy/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-record-tyidyv7j/install-record.txt --single-version-externally-managed --compile --install-headers /Users/sudoxx2/Documents/github/delete_copy/env/include/site/python3.7/psycopg2
         cwd: /private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/
    Complete output (48 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.7
    creating build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_json.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/extras.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/compat.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/errorcodes.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/tz.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_range.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_ipaddress.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_lru_cache.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/extensions.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/errors.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/sql.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/pool.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    running build_ext
    building 'psycopg2._psycopg' extension
    creating build/temp.macosx-10.9-x86_64-3.7
    creating build/temp.macosx-10.9-x86_64-3.7/psycopg
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=110004 -DHAVE_LO64=1 -I/Users/sudoxx2/Documents/github/delete_copy/env/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/Cellar/postgresql/11.4/include -I/usr/local/Cellar/postgresql/11.4/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.9-x86_64-3.7/psycopg/psycopgmodule.o
    In file included from psycopg/psycopgmodule.c:27:
    In file included from ./psycopg/psycopg.h:34:
    /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h:30:10: warning: non-portable path to file '<String.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
    #include <string.h>
             ^~~~~~~~~~
             <String.h>
    In file included from psycopg/psycopgmodule.c:27:
    In file included from ./psycopg/psycopg.h:34:
    In file included from /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h:30:
    /usr/local/include/string.h:25:10: fatal error: 'plist/Node.h' file not found
    #include <plist/Node.h>
             ^~~~~~~~~~~~~~
    1 warning and 1 error generated.

    It appears you are missing some prerequisite to build the package from source.

    You may install a binary package by installing 'psycopg2-binary' from PyPI.
    If you want to install psycopg2 from source, please install the packages
    required for the build and try again.

    For further information please check the 'doc/src/install.rst' file (also at
    <http://initd.org/psycopg/docs/install.html>).

    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/sudoxx2/Documents/github/delete_copy/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-record-tyidyv7j/install-record.txt --single-version-externally-managed --compile --install-headers /Users/sudoxx2/Documents/github/delete_copy/env/include/site/python3.7/psycopg2 Check the logs for full command output.(env) MacBook-Pro:testing_django sudoxx2$ pip install psycopg2-binary
Collecting psycopg2-binary
  Using cached https://files.pythonhosted.org/packages/ee/ed/2772267467ba5c21a73d37149da0b49a4343c6646d501dbb1450b492d40a/psycopg2_binary-2.8.3-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Installing collected packages: psycopg2-binary
Successfully installed psycopg2-binary-2.8.3
(env) MacBook-Pro:testing_django sudoxx2$ pip install django-heroku
Collecting django-heroku
  Using cached https://files.pythonhosted.org/packages/59/af/5475a876c5addd5a3494db47d9f7be93cc14d3a7603542b194572791b6c6/django_heroku-0.3.1-py2.py3-none-any.whl
Collecting psycopg2 (from django-heroku)
  Using cached https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
Requirement already satisfied: whitenoise in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django-heroku) (4.1.3)
Requirement already satisfied: django in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django-heroku) (2.2.3)
Requirement already satisfied: dj-database-url>=0.5.0 in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django-heroku) (0.5.0)
Requirement already satisfied: sqlparse in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django->django-heroku) (0.3.0)
Requirement already satisfied: pytz in /Users/sudoxx2/Documents/github/delete_copy/env/lib/python3.7/site-packages (from django->django-heroku) (2019.1)
Installing collected packages: psycopg2, django-heroku
  Running setup.py install for psycopg2 ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/sudoxx2/Documents/github/delete_copy/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-record-tyidyv7j/install-record.txt --single-version-externally-managed --compile --install-headers /Users/sudoxx2/Documents/github/delete_copy/env/include/site/python3.7/psycopg2
         cwd: /private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/
    Complete output (48 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.7
    creating build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_json.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/extras.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/compat.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/errorcodes.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/tz.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_range.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_ipaddress.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/_lru_cache.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/extensions.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/errors.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/sql.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    copying lib/pool.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
    running build_ext
    building 'psycopg2._psycopg' extension
    creating build/temp.macosx-10.9-x86_64-3.7
    creating build/temp.macosx-10.9-x86_64-3.7/psycopg
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=110004 -DHAVE_LO64=1 -I/Users/sudoxx2/Documents/github/delete_copy/env/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/Cellar/postgresql/11.4/include -I/usr/local/Cellar/postgresql/11.4/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.9-x86_64-3.7/psycopg/psycopgmodule.o
    In file included from psycopg/psycopgmodule.c:27:
    In file included from ./psycopg/psycopg.h:34:
    /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h:30:10: warning: non-portable path to file '<String.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
    #include <string.h>
             ^~~~~~~~~~
             <String.h>
    In file included from psycopg/psycopgmodule.c:27:
    In file included from ./psycopg/psycopg.h:34:
    In file included from /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h:30:
    /usr/local/include/string.h:25:10: fatal error: 'plist/Node.h' file not found
    #include <plist/Node.h>
             ^~~~~~~~~~~~~~
    1 warning and 1 error generated.

    It appears you are missing some prerequisite to build the package from source.

    You may install a binary package by installing 'psycopg2-binary' from PyPI.
    If you want to install psycopg2 from source, please install the packages
    required for the build and try again.

    For further information please check the 'doc/src/install.rst' file (also at
    <http://initd.org/psycopg/docs/install.html>).

    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/sudoxx2/Documents/github/delete_copy/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-install-cq6yuehb/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/4d/s84v7k6d1dx_m_6qbd1wfbz80000gp/T/pip-record-tyidyv7j/install-record.txt --single-version-externally-managed --compile --install-headers /Users/sudoxx2/Documents/github/delete_copy/env/include/site/python3.7/psycopg2 Check the logs for full command output.

我试了pip install psycopg2-binary次,但没有成功.

做了一个新的项目进行测试,并有相同的错误.

任何帮助都会很棒.


更新日期:2019年7月31日

我在windows 10上进行了测试,一切都顺利通过,并能够部署到heroku.似乎这可能是莫哈韦操作系统特有的.

推荐答案

我在windows 10上测试了同样的步骤,一切顺利,我能够部署到heroku.

似乎这可能是MAC OS Mojave特有的.

MacOS Mojave 10.14.6是我遇到问题的版本

我的解决方案是通过windows 10进行部署,或者降级到High Sierra等较旧的Mac操作系统.

Python-3.x相关问答推荐

根据收件箱内部的值以行降序的特定顺序重新排序列

需要使用regex匹配字符串的帮助,直到最后一次出现开闭括号,开闭括号中的值是可选的

While循环不停止地等待,直到时间.睡眠结束

PYSMB中的进度条

如何从选定的html内容中获取所需的文本

以特定方式重新排列 pandas 数据框的列

为什么不能用格式字符串 '-' 绘制点?

Python base64.b32hexencode 未创建预期结果

Python3:是否可以将变量用作函数调用的一部分

根据另一个数据帧中的位置从主数据帧中提取子序列

如何在Pandas 中按条件计算分组?

类型提示和链式赋值以及多重赋值

错误:预期语句,发现 py:Dedent

Python 错误:IndexError:字符串索引超出范围

迭代dict值

如何获得 BeautifulSoup 标签的所有直接子代?

在 Python 3 中调用 super() 的 4 种方法中的哪一种?

Python 3 - Zip 是 pandas 数据框中的迭代器

finally 总是在 try 块返回之前运行,那么为什么 finally 块中的更新不会影响 try 块返回的变量的值呢?

调用 Python doctest 时如何启用省略号?