简体   繁体   English

为什么我的 django 应用程序无法部署到 heroku(“为 psycopg2 构建轮子”)?

[英]Why does my django app fail to deploy to heroku ("building wheel for psycopg2")?

While trying to deploy a django app to heroku I am running into an issue that I can not seem to fix, and I am getting increasingly desperate.在尝试将 django 应用程序部署到 heroku 时,我遇到了一个似乎无法解决的问题,而且我越来越绝望。

When I enter the command当我输入命令

git push heroku master

it runs into the following error它遇到以下错误

remote:          Collecting sqlparse>=0.2.2
remote:          Downloading sqlparse-0.4.1-py3-none-any.whl (42 kB)
remote:          Building wheels for collected packages: Pillow, psycopg2
remote:          Building wheel for Pillow (setup.py): started
remote:          Building wheel for Pillow (setup.py): finished with status 'done'
remote:          Created wheel for Pillow: filename=Pillow-5.2.0-cp39-cp39-linux_x86_64.whl size=1316371 sha256=cb80053184568f78e761e74c93e38682de7c3000417f9d12e7b37971f12dfcd0
remote:          Stored in directory: /tmp/pip-ephem-wheel-cache-4bhzio_g/wheels/2e/0c/21/df64563df0fe8750c4bff3e38b90f223df6c02aa5c5b570905
remote:          Building wheel for psycopg2 (setup.py): started
remote:          Building wheel for psycopg2 (setup.py): finished with status 'error'
remote:          ERROR: Command errored out with exit status 1:
remote:           command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tajnjqcx/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tajnjqcx/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-9ekv4vgu
remote:               cwd: /tmp/pip-install-tajnjqcx/psycopg2/

As far as I understand it, it tries to install the dependencies in my requirements.txt file.据我了解,它会尝试在我的 requirements.txt 文件中安装依赖项。

I tried to我尝试过了

  1. change psycopg2 to psycopg2-binary将 psycopg2 更改为 psycopg2-binary
  2. change the version number of psycopg2更改 psycopg2 的版本号
  3. remove it entirely完全删除它

all to no avail: It still tried to "build wheel" for it.无济于事:它仍然试图为它“造轮子”。 I really have no idea what the error means and I am at a complete loss here.我真的不知道这个错误是什么意思,我在这里完全不知所措。 This is the complete console output.这是完整的控制台 output。

Enumerating objects: 937, done.
Counting objects: 100% (937/937), done.
Delta compression using up to 4 threads
Compressing objects: 100% (711/711), done.
Writing objects: 100% (937/937), 400.51 KiB | 3.08 MiB/s, done.
Total 937 (delta 620), reused 271 (delta 173)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Python app detected
remote: -----> No Python version was specified. Using the buildpack default: python-3.9.6
remote:        To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.9.6
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting Django==3.1.7
remote:          Downloading Django-3.1.7-py3-none-any.whl (7.8 MB)
remote:        Collecting djangorestframework==3.12.4
remote:          Downloading djangorestframework-3.12.4-py3-none-any.whl (957 kB)
remote:        Collecting boto3==1.9.96
remote:          Downloading boto3-1.9.96-py2.py3-none-any.whl (128 kB)
remote:        Collecting botocore==1.12.96
remote:          Downloading botocore-1.12.96-py2.py3-none-any.whl (5.3 MB)
remote:        Collecting certifi==2018.10.15
remote:          Downloading certifi-2018.10.15-py2.py3-none-any.whl (146 kB)
remote:        Collecting chardet==3.0.4
remote:          Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
remote:        Collecting dj-database-url==0.5.0
remote:          Downloading dj_database_url-0.5.0-py2.py3-none-any.whl (5.5 kB)
remote:        Collecting django-crispy-forms==1.7.2
remote:          Downloading django_crispy_forms-1.7.2-py2.py3-none-any.whl (105 kB)
remote:        Collecting django-heroku==0.3.1
remote:          Downloading django_heroku-0.3.1-py2.py3-none-any.whl (6.2 kB)
remote:        Collecting django-storages==1.7.1
remote:          Downloading django_storages-1.7.1-py2.py3-none-any.whl (44 kB)
remote:        Collecting docutils==0.14
remote:          Downloading docutils-0.14-py3-none-any.whl (543 kB)
remote:        Collecting gunicorn==19.9.0
remote:          Downloading gunicorn-19.9.0-py2.py3-none-any.whl (112 kB)
remote:        Collecting idna==2.7
remote:          Downloading idna-2.7-py2.py3-none-any.whl (58 kB)
remote:        Collecting jmespath==0.9.3
remote:          Downloading jmespath-0.9.3-py2.py3-none-any.whl (23 kB)
remote:        Collecting Pillow==5.2.0
remote:          Downloading Pillow-5.2.0.tar.gz (14.5 MB)
remote:        Collecting psycopg2==2.7.7
remote:          Downloading psycopg2-2.7.7.tar.gz (427 kB)
remote:        Collecting python-dateutil==2.8.0
remote:          Downloading python_dateutil-2.8.0-py2.py3-none-any.whl (226 kB)
remote:        Collecting pytz==2018.5
remote:          Downloading pytz-2018.5-py2.py3-none-any.whl (510 kB)
remote:        Collecting requests==2.19.1
remote:          Downloading requests-2.19.1-py2.py3-none-any.whl (91 kB)
remote:        Collecting s3transfer==0.2.0
remote:          Downloading s3transfer-0.2.0-py2.py3-none-any.whl (69 kB)
remote:        Collecting six==1.12.0
remote:          Downloading six-1.12.0-py2.py3-none-any.whl (10 kB)
remote:        Collecting urllib3==1.23
remote:          Downloading urllib3-1.23-py2.py3-none-any.whl (133 kB)
remote:        Collecting whitenoise==4.1.2
remote:          Downloading whitenoise-4.1.2-py2.py3-none-any.whl (19 kB)
remote:        Collecting asgiref<4,>=3.2.10
remote:          Downloading asgiref-3.4.1-py3-none-any.whl (25 kB)
remote:        Collecting sqlparse>=0.2.2
remote:          Downloading sqlparse-0.4.1-py3-none-any.whl (42 kB)
remote:        Building wheels for collected packages: Pillow, psycopg2
remote:          Building wheel for Pillow (setup.py): started
remote:          Building wheel for Pillow (setup.py): finished with status 'done'
remote:          Created wheel for Pillow: filename=Pillow-5.2.0-cp39-cp39-linux_x86_64.whl size=1316392 sha256=69fcc0f3c66aa43e6908ae3b4beeece5cfe2f390d14b07f43084b461fff5b94c
remote:          Stored in directory: /tmp/pip-ephem-wheel-cache-6qfrrkl1/wheels/2e/0c/21/df64563df0fe8750c4bff3e38b90f223df6c02aa5c5b570905
remote:          Building wheel for psycopg2 (setup.py): started
remote:          Building wheel for psycopg2 (setup.py): finished with status 'error'
remote:          ERROR: Command errored out with exit status 1:
remote:           command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jic1i6ze/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jic1i6ze/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-k6s2rfim
remote:               cwd: /tmp/pip-install-jic1i6ze/psycopg2/
remote:          Complete output (86 lines):
remote:          running bdist_wheel
remote:          running build
remote:          running build_py
remote:          creating build
remote:          creating build/lib.linux-x86_64-3.9
remote:          creating build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/pool.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/_json.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/__init__.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/extras.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/_range.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/extensions.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/errorcodes.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/tz.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/psycopg1.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          copying lib/sql.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:          creating build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_quote.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_with.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_sql.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_async_keyword.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_replication.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_copy.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_errcodes.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_cursor.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_extras_dictcursor.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/__init__.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/testutils.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_types_basic.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_connection.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/dbapi20_tpc.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_async.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/testconfig.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_types_extras.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_psycopg2_dbapi20.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_module.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_bug_gc.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_notify.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_green.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_cancel.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_dates.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_lobject.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_bugX000.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/dbapi20.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_ipaddress.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_transaction.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          copying tests/test_fast_executemany.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:          Skipping optional fixer: buffer
remote:          Skipping optional fixer: idioms
remote:          Skipping optional fixer: set_literal
remote:          Skipping optional fixer: ws_comma
remote:          running build_ext
remote:          building 'psycopg2._psycopg' extension
remote:          creating build/temp.linux-x86_64-3.9
remote:          creating build/temp.linux-x86_64-3.9/psycopg
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_asis.o -Wdeclaration-after-statement


[...]



remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/error_type.c -o build/temp.linux-x86_64-3.9/psycopg/error_type.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/green.c -o build/temp.linux-x86_64-3.9/psycopg/green.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/libpq_support.c -o build/temp.linux-x86_64-3.9/psycopg/libpq_support.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/lobject_int.c -o build/temp.linux-x86_64-3.9/psycopg/lobject_int.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/lobject_type.c -o build/temp.linux-x86_64-3.9/psycopg/lobject_type.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/microprotocols.c -o build/temp.linux-x86_64-3.9/psycopg/microprotocols.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/microprotocols_proto.c -o build/temp.linux-x86_64-3.9/psycopg/microprotocols_proto.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/notify_type.c -o build/temp.linux-x86_64-3.9/psycopg/notify_type.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/pqpath.c -o build/temp.linux-x86_64-3.9/psycopg/pqpath.o -Wdeclaration-after-statement
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.9/psycopg/psycopgmodule.o -Wdeclaration-after-statement
remote:          psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’:
remote:          psycopg/psycopgmodule.c:689:18: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
remote:            689 |     while (interp->next)
remote:                |                  ^~
remote:          error: command '/usr/bin/gcc' failed with exit code 1
remote:          ----------------------------------------
remote:          ERROR: Failed building wheel for psycopg2
remote:          Running setup.py clean for psycopg2
remote:        Successfully built Pillow
remote:        Failed to build psycopg2
remote:        Installing collected packages: asgiref, pytz, sqlparse, Django, djangorestframework, six, python-dateutil, urllib3, docutils, jmespath, botocore, s3transfer, boto3, certifi, chardet, dj-database-url, django-crispy-forms, whitenoise, psycopg2, django-heroku, django-storages, gunicorn, idna, Pillow, requests
remote:            Running setup.py install for psycopg2: started
remote:            Running setup.py install for psycopg2: finished with status 'error'
remote:            ERROR: Command errored out with exit status 1:
remote:             command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jic1i6ze/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jic1i6ze/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 /tmp/pip-record-3lnkpduv/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/psycopg2
remote:                 cwd: /tmp/pip-install-jic1i6ze/psycopg2/
remote:            Complete output (86 lines):
remote:            running install
remote:            running build
remote:            running build_py
remote:            creating build
remote:            creating build/lib.linux-x86_64-3.9
remote:            creating build/lib.linux-x86_64-3.9/psycopg2
remote:            copying lib/pool.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:            copying lib/_json.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:            copying lib/__init__.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:            copying lib/extras.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:            copying lib/_range.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:            copying lib/extensions.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:            copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:            copying lib/errorcodes.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:            copying lib/tz.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:            copying lib/psycopg1.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:            copying lib/sql.py -> build/lib.linux-x86_64-3.9/psycopg2
remote:            creating build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_quote.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_with.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_sql.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_async_keyword.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_replication.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_copy.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_errcodes.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_cursor.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_extras_dictcursor.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/__init__.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/testutils.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_types_basic.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_connection.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/dbapi20_tpc.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_async.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/testconfig.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_types_extras.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_psycopg2_dbapi20.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_module.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_bug_gc.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_notify.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_green.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_cancel.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_dates.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_lobject.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_bugX000.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/dbapi20.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_ipaddress.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_transaction.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            copying tests/test_fast_executemany.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
remote:            Skipping optional fixer: buffer
remote:            Skipping optional fixer: idioms
remote:            Skipping optional fixer: set_literal
remote:            Skipping optional fixer: ws_comma
remote:            running build_ext
remote:            building 'psycopg2._psycopg' extension
remote:            creating build/temp.linux-x86_64-3.9
remote:            creating build/temp.linux-x86_64-3.9/psycopg
remote:            gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_asis.o -Wdeclaration-after-statement
remote:            gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_binary.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_binary.o -Wdeclaration-after-statement


[...]


remote:            gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/microprotocols_proto.c -o build/temp.linux-x86_64-3.9/psycopg/microprotocols_proto.o -Wdeclaration-after-statement
remote:            gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/notify_type.c -o build/temp.linux-x86_64-3.9/psycopg/notify_type.o -Wdeclaration-after-statement
remote:            gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/pqpath.c -o build/temp.linux-x86_64-3.9/psycopg/pqpath.o -Wdeclaration-after-statement
remote:            gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=2.7.7 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.9/psycopg/psycopgmodule.o -Wdeclaration-after-statement
remote:            psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’:
remote:            psycopg/psycopgmodule.c:689:18: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
remote:              689 |     while (interp->next)
remote:                  |                  ^~
remote:            error: command '/usr/bin/gcc' failed with exit code 1
remote:            ----------------------------------------
remote:        ERROR: Command errored out with exit status 1: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jic1i6ze/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jic1i6ze/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 /tmp/pip-record-3lnkpduv/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/psycopg2 Check the logs for full command output.
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: 8ee480c755d5463f245c3ee4e08f878693eb2773
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 8ee480c755d5463f245c3ee4e08f878693eb2773
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote: 
remote: Verifying deploy...
remote: 
remote: !   Push rejected to <myproject>

I would really like to continue this project but have no idea how.我真的很想继续这个项目,但不知道如何做。 Any help is appreciated.任何帮助表示赞赏。 Thanks in advance!提前致谢!

I think I remember facing this issue previously.我想我记得以前遇到过这个问题。 I have successfully been able to deploy multiple Django apps following this tutorial: https://youtu.be/GMbVzl_aLxM Give it a try and let me know if it helps我已经按照本教程成功部署了多个 Django 应用程序: https://youtu.be/GMbVzl_aLxM试试看,如果有帮助请告诉我

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM