miguelgrinberg / flasky

Companion code to my O'Reilly book "Flask Web Development", second edition.
MIT License
8.54k stars 4.21k forks source link

Upload the application to the Heroku servers error. 2nd Ed. 17c #524

Closed yehuihe closed 3 years ago

yehuihe commented 3 years ago

Hi Mr. Grinberg,

I'm following your 2nd edition book. Currently tyring to deploy the app to Heroku. In chapter 17: Heroku support with Gunicorn (17c). Page 254. When i hit

git push heroku master

It seems build failed on heroku. The following is the entire build log on heroku. seems main problem is psycopg2.

I checked my pip list. I did pip install -r requirement.txt which gives me psycopg2==2.7.3. But I don't understand why it failed.

I would really appreciate if you can give me a hand.

-----> Building on the Heroku-20 stack -----> Determining which buildpack to use for this app -----> Python app detected -----> No Python version was specified. Using the buildpack default: python-3.9.7 To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes -----> Installing python-3.9.7 -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0 -----> Installing SQLite3 -----> Installing requirements with pip Collecting alembic==0.9.3 Downloading alembic-0.9.3.tar.gz (991 kB) Collecting bleach==2.0.0 Downloading bleach-2.0.0-py2.py3-none-any.whl (23 kB) Collecting blinker==1.4 Downloading blinker-1.4.tar.gz (111 kB) Collecting click==6.7 Downloading click-6.7-py2.py3-none-any.whl (71 kB) Collecting dominate==2.3.1 Downloading dominate-2.3.1.tar.gz (27 kB) Collecting Flask==0.12.2 Downloading Flask-0.12.2-py2.py3-none-any.whl (83 kB) Collecting Flask-Bootstrap==3.3.7.1 Downloading Flask-Bootstrap-3.3.7.1.tar.gz (456 kB) Collecting Flask-HTTPAuth==3.2.3 Downloading Flask_HTTPAuth-3.2.3-py2.py3-none-any.whl (4.8 kB) Collecting Flask-Login==0.4.0 Downloading Flask_Login-0.4.0-py2.py3-none-any.whl (15 kB) Collecting Flask-Mail==0.9.1 Downloading Flask-Mail-0.9.1.tar.gz (45 kB) Collecting Flask-Migrate==2.0.4 Downloading Flask-Migrate-2.0.4.tar.gz (14 kB) Collecting Flask-Moment==0.5.1 Downloading Flask-Moment-0.5.1.tar.gz (4.6 kB) Collecting Flask-PageDown==0.2.2 Downloading Flask_PageDown-0.2.2-py2.py3-none-any.whl (4.1 kB) Collecting Flask-SQLAlchemy==2.2 Downloading Flask_SQLAlchemy-2.2-py2.py3-none-any.whl (14 kB) Collecting Flask-WTF==0.14.2 Downloading Flask_WTF-0.14.2-py2.py3-none-any.whl (14 kB) Collecting html5lib==0.999999999 Downloading html5lib-0.999999999-py2.py3-none-any.whl (112 kB) Collecting itsdangerous==0.24 Downloading itsdangerous-0.24.tar.gz (46 kB) Collecting Jinja2==2.9.6 Downloading Jinja2-2.9.6-py2.py3-none-any.whl (340 kB) Collecting Mako==1.0.7 Downloading Mako-1.0.7.tar.gz (564 kB) Collecting Markdown==2.6.8 Downloading Markdown-2.6.8.tar.gz (307 kB) Collecting MarkupSafe==1.1.1 Downloading MarkupSafe-1.1.1-cp39-cp39-manylinux2010_x86_64.whl (32 kB) Collecting python-dateutil==2.6.1 Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194 kB) Collecting python-dotenv==0.6.5 Downloading python_dotenv-0.6.5-py2.py3-none-any.whl (13 kB) Collecting python-editor==1.0.3 Downloading python-editor-1.0.3.tar.gz (7.0 kB) Collecting six==1.10.0 Downloading six-1.10.0-py2.py3-none-any.whl (10 kB) Collecting SQLAlchemy==1.1.11 Downloading SQLAlchemy-1.1.11.tar.gz (5.2 MB) Collecting visitor==0.1.3 Downloading visitor-0.1.3.tar.gz (3.3 kB) Collecting webencodings==0.5.1 Downloading webencodings-0.5.1-py2.py3-none-any.whl (11 kB) Collecting Werkzeug==0.12.2 Downloading Werkzeug-0.12.2-py2.py3-none-any.whl (312 kB) Collecting WTForms==2.1 Downloading WTForms-2.1.zip (553 kB) Collecting Flask-SSLify==0.1.5 Downloading Flask-SSLify-0.1.5.tar.gz (3.0 kB) Collecting gunicorn==19.7.1 Downloading gunicorn-19.7.1-py2.py3-none-any.whl (111 kB) Collecting psycopg2==2.7.3 Downloading psycopg2-2.7.3.tar.gz (425 kB) Collecting Flask-Script>=0.6 Downloading Flask-Script-2.0.6.tar.gz (43 kB) Building wheels for collected packages: alembic, blinker, dominate, Flask-Bootstrap, Flask-Mail, Flask-Migrate, Flask-Moment, itsdangerous, Mako, Markdown, python-editor, SQLAlchemy, visitor, WTForms, Flask-SSLify, psycopg2, Flask-Script Building wheel for alembic (setup.py): started Building wheel for alembic (setup.py): finished with status 'done' Created wheel for alembic: filename=alembic-0.9.3-py2.py3-none-any.whl size=152582 sha256=e2d60f8327d40fd28bced3141bf2d355ed8be4acace1ab90332c14a9993a9f35 Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/ce/16/4e/be76104147c63d16b0a480e5408741fb4a785fff32e4ddfdee Building wheel for blinker (setup.py): started Building wheel for blinker (setup.py): finished with status 'done' Created wheel for blinker: filename=blinker-1.4-py3-none-any.whl size=13478 sha256=5fe6cdbb14cb2a33e2488f58fdc400f08afd0f0a8b030ab6800a8eb6936f99d8 Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/50/93/f8/4f0a42a03a06626d675f13907b6982ad5ecff383530af5a900 Building wheel for dominate (setup.py): started Building wheel for dominate (setup.py): finished with status 'done' Created wheel for dominate: filename=dominate-2.3.1-py3-none-any.whl size=25369 sha256=5d39475fbd316fb212bbe801b1e741886df39f60c3f012f1cdb3328b0e0c0fd4 Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/4e/b0/ad/ed8d392543832d5ec22b4bf43032a5a63fe08beda6b1c32d16 Building wheel for Flask-Bootstrap (setup.py): started Building wheel for Flask-Bootstrap (setup.py): finished with status 'done' Created wheel for Flask-Bootstrap: filename=Flask_Bootstrap-3.3.7.1-py3-none-any.whl size=460124 sha256=52ad36d0c1d8e7b3a65fad2e1edad92295ad19c0cf1e9cfb76f7805b89efecc8 Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/bb/41/c0/e09286bce2bca8d80bcaeccf519aa73b9747278e78ca83ce3f Building wheel for Flask-Mail (setup.py): started Building wheel for Flask-Mail (setup.py): finished with status 'done' Created wheel for Flask-Mail: filename=Flask_Mail-0.9.1-py3-none-any.whl size=7579 sha256=3b7490ae650f10a7709719923973e8bfe7f372fa21499e1f87f3f161a122efb3 Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/46/f9/d1/7fb1d1ae35210f02223b4502e2724235cffaed49e22df5007f Building wheel for Flask-Migrate (setup.py): started Building wheel for Flask-Migrate (setup.py): finished with status 'done' Created wheel for Flask-Migrate: filename=Flask_Migrate-2.0.4-py3-none-any.whl size=13206 sha256=2da92148e9940228c162763e73928ca3636f8a81fb2365d41e815ae1891937cf Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/36/ae/21/82ca2872701a0a21ecee265e4c26acd7f87284d997c5d0db4b Building wheel for Flask-Moment (setup.py): started Building wheel for Flask-Moment (setup.py): finished with status 'done' Created wheel for Flask-Moment: filename=Flask_Moment-0.5.1-py3-none-any.whl size=3469 sha256=281f5703977cd3ff5b47ab330155c9af72ae43b079a8e3de1fe3c6d3e4a780fa Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/64/a3/05/a327ceaa050ad45639c760cbe5837e18e1cdf64a796b2a0150 Building wheel for itsdangerous (setup.py): started Building wheel for itsdangerous (setup.py): finished with status 'done' Created wheel for itsdangerous: filename=itsdangerous-0.24-py3-none-any.whl size=10636 sha256=a36b372397e63a91b217f1efb507337ab2a60dff67f8c085a86cd7fa7a774ecf Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/b6/3b/2f/88f28d2646664615853cc9d243549c09b46fb36fddc160fea3 Building wheel for Mako (setup.py): started Building wheel for Mako (setup.py): finished with status 'done' Created wheel for Mako: filename=Mako-1.0.7-py3-none-any.whl size=76602 sha256=c81b0f65d3e0d794dff9a3587441c8d78a381f4a690cdb70d8217e07480384d9 Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/b5/59/66/cad164896c8aa325c46f35b07b6ff9e7781221e12da915d1f3 Building wheel for Markdown (setup.py): started Building wheel for Markdown (setup.py): finished with status 'done' Created wheel for Markdown: filename=Markdown-2.6.8-py3-none-any.whl size=163190 sha256=a78116d785bbf9dc1298790df73b14b12cd89ed38fc1010d677b7278bc7e67b6 Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/9d/34/d0/3e9c2d484288b4cbf4b61ffe7b6559580a87394d13cd954bd2 Building wheel for python-editor (setup.py): started Building wheel for python-editor (setup.py): finished with status 'done' Created wheel for python-editor: filename=python_editor-1.0.3-py3-none-any.whl size=6702 sha256=05994330862ac491807e6f076ed14adb532bcf8e92a8817455ee6e55bca66adc Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/6c/e4/ec/734634ad1b0cf838a2fa2a08d84f54521aa9b7ec667db8eb4b Building wheel for SQLAlchemy (setup.py): started Building wheel for SQLAlchemy (setup.py): finished with status 'done' Created wheel for SQLAlchemy: filename=SQLAlchemy-1.1.11-cp39-cp39-linux_x86_64.whl size=1095808 sha256=3f1b1085adaa79f3c5ac12e369132ea7746f09639a7cad5258068293c7d31e87 Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/ad/cb/7d/54a1fed33b148a4db327597f9084659f3ba769db9c9e9bb905 Building wheel for visitor (setup.py): started Building wheel for visitor (setup.py): finished with status 'done' Created wheel for visitor: filename=visitor-0.1.3-py3-none-any.whl size=3943 sha256=a38e4a4753e8f242ac84eaf4e3c4c4df6e77dffd2cc09b3705e37602dee75f6e Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/cd/93/8e/b92d317bbcc888f0bdcd7df644ae49e8e0f1b4f738eec61b82 Building wheel for WTForms (setup.py): started Building wheel for WTForms (setup.py): finished with status 'done' Created wheel for WTForms: filename=WTForms-2.1-py2.py3-none-any.whl size=140874 sha256=3fa74dfef48b8ebc3b76badc8f3d70702dabdb7f66522a8b86e9bae2d08ba8a2 Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/dc/fd/f8/5f2db4f1793f78ff91a650a90b0862cbe36b122d943f49e6a4 Building wheel for Flask-SSLify (setup.py): started Building wheel for Flask-SSLify (setup.py): finished with status 'done' Created wheel for Flask-SSLify: filename=Flask_SSLify-0.1.5-py3-none-any.whl size=2440 sha256=bf3129fe093357e7338969eacdaa276a6a43e08cd8068f572f11c3063eb7d2e0 Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/ec/43/37/f875c35f6d04804067910ffad3d53c2c18aee96a4512c0febf Building wheel for psycopg2 (setup.py): started Building wheel for psycopg2 (setup.py): finished with status 'error' ERROR: Command errored out with exit status 1: command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-hzg6fcp3/psycopg2/setup.py'"'"'; file='"'"'/tmp/pip-install-hzg6fcp3/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-puhs3ttc cwd: /tmp/pip-install-hzg6fcp3/psycopg2/ Complete output (86 lines): running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.9 creating build/lib.linux-x86_64-3.9/psycopg2 copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.9/psycopg2 copying lib/psycopg1.py -> build/lib.linux-x86_64-3.9/psycopg2 copying lib/extras.py -> build/lib.linux-x86_64-3.9/psycopg2 copying lib/extensions.py -> build/lib.linux-x86_64-3.9/psycopg2 copying lib/pool.py -> build/lib.linux-x86_64-3.9/psycopg2 copying lib/_range.py -> build/lib.linux-x86_64-3.9/psycopg2 copying lib/tz.py -> build/lib.linux-x86_64-3.9/psycopg2 copying lib/_json.py -> build/lib.linux-x86_64-3.9/psycopg2 copying lib/init.py -> build/lib.linux-x86_64-3.9/psycopg2 copying lib/sql.py -> build/lib.linux-x86_64-3.9/psycopg2 copying lib/errorcodes.py -> build/lib.linux-x86_64-3.9/psycopg2 creating build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_fast_executemany.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_quote.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_cancel.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_types_extras.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_connection.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_types_basic.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/dbapi20_tpc.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/testutils.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_psycopg2_dbapi20.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_copy.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_async.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_lobject.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_errcodes.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_green.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_cursor.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_module.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_dates.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_bug_gc.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/testconfig.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/init.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/dbapi20.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_with.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_async_keyword.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_bugX000.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_ipaddress.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_sql.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_notify.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_replication.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_transaction.py -> build/lib.linux-x86_64-3.9/psycopg2/tests copying tests/test_extras_dictcursor.py -> build/lib.linux-x86_64-3.9/psycopg2/tests Skipping optional fixer: buffer Skipping optional fixer: idioms Skipping optional fixer: set_literal Skipping optional fixer: ws_comma running build_ext building 'psycopg2._psycopg' extension creating build/temp.linux-x86_64-3.9 creating build/temp.linux-x86_64-3.9/psycopg gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_datetime.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_datetime.o -Wdeclaration-after-statement gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_list.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_list.o -Wdeclaration-after-statement gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_pboolean.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_pboolean.o -Wdeclaration-after-statement gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_pdecimal.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_pdecimal.o -Wdeclaration-after-statement gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_pfloat.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_pfloat.o -Wdeclaration-after-statement gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_pint.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_pint.o -Wdeclaration-after-statement gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_qstring.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_qstring.o -Wdeclaration-after-statement gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/bytes_format.c -o build/temp.linux-x86_64-3.9/psycopg/bytes_format.o -Wdeclaration-after-statement gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/connection_int.c -o build/temp.linux-x86_64-3.9/psycopg/connection_int.o -Wdeclaration-after-statement gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/connection_type.c -o build/temp.linux-x86_64-3.9/psycopg/connection_type.o -Wdeclaration-after-statement gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/cursor_int.c -o build/temp.linux-x86_64-3.9/psycopg/cursor_int.o -Wdeclaration-after-statement gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/cursor_type.c -o build/temp.linux-x86_64-3.9/psycopg/cursor_type.o -Wdeclaration-after-statement gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/diagnostics_type.c -o build/temp.linux-x86_64-3.9/psycopg/diagnostics_type.o -Wdeclaration-after-statement gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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 psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’: psycopg/psycopgmodule.c:685:18: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’} 685 | while (interp->next) | ^~ error: command '/usr/bin/gcc' failed with exit code 1

     ERROR: Failed building wheel for psycopg2
     Running setup.py clean for psycopg2
     Building wheel for Flask-Script (setup.py): started
     Building wheel for Flask-Script (setup.py): finished with status 'done'
     Created wheel for Flask-Script: filename=Flask_Script-2.0.6-py3-none-any.whl size=14030 sha256=7f39f55eb3c72ff59cb49eb23e36d74cf32a2f99111dd7d5ed402377a550bd42
     Stored in directory: /tmp/pip-ephem-wheel-cache-ytb8wi2w/wheels/2a/ae/8b/66d1d7344c5dbc14b561c54e9008244a89574abdd4a1ed3bd2
   Successfully built alembic blinker dominate Flask-Bootstrap Flask-Mail Flask-Migrate Flask-Moment itsdangerous Mako Markdown python-editor SQLAlchemy visitor WTForms Flask-SSLify Flask-Script
   Failed to build psycopg2
   Installing collected packages: SQLAlchemy, MarkupSafe, Mako, python-editor, six, python-dateutil, alembic, webencodings, html5lib, bleach, blinker, click, dominate, Jinja2, itsdangerous, Werkzeug, Flask, visitor, Flask-Bootstrap, Flask-HTTPAuth, Flask-Login, Flask-Mail, Flask-SQLAlchemy, Flask-Script, Flask-Migrate, Flask-Moment, WTForms, Flask-PageDown, Flask-WTF, Markdown, python-dotenv, Flask-SSLify, gunicorn, psycopg2
       Running setup.py install for psycopg2: started
       Running setup.py install for psycopg2: finished with status 'error'
       ERROR: Command errored out with exit status 1:
        command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-hzg6fcp3/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-hzg6fcp3/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-_cah6o9a/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/psycopg2
            cwd: /tmp/pip-install-hzg6fcp3/psycopg2/
       Complete output (86 lines):
       running install
       running build
       running build_py
       creating build
       creating build/lib.linux-x86_64-3.9
       creating build/lib.linux-x86_64-3.9/psycopg2
       copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.9/psycopg2
       copying lib/psycopg1.py -> build/lib.linux-x86_64-3.9/psycopg2
       copying lib/extras.py -> build/lib.linux-x86_64-3.9/psycopg2
       copying lib/extensions.py -> build/lib.linux-x86_64-3.9/psycopg2
       copying lib/pool.py -> build/lib.linux-x86_64-3.9/psycopg2
       copying lib/_range.py -> build/lib.linux-x86_64-3.9/psycopg2
       copying lib/tz.py -> build/lib.linux-x86_64-3.9/psycopg2
       copying lib/_json.py -> build/lib.linux-x86_64-3.9/psycopg2
       copying lib/__init__.py -> build/lib.linux-x86_64-3.9/psycopg2
       copying lib/sql.py -> build/lib.linux-x86_64-3.9/psycopg2
       copying lib/errorcodes.py -> build/lib.linux-x86_64-3.9/psycopg2
       creating build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_fast_executemany.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_quote.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_cancel.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_types_extras.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_connection.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_types_basic.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/dbapi20_tpc.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/testutils.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_psycopg2_dbapi20.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_copy.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_async.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_lobject.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_errcodes.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_green.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_cursor.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_module.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_dates.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_bug_gc.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/testconfig.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/__init__.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/dbapi20.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_with.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_async_keyword.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_bugX000.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_ipaddress.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_sql.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_notify.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_replication.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_transaction.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       copying tests/test_extras_dictcursor.py -> build/lib.linux-x86_64-3.9/psycopg2/tests
       Skipping optional fixer: buffer
       Skipping optional fixer: idioms
       Skipping optional fixer: set_literal
       Skipping optional fixer: ws_comma
       running build_ext
       building 'psycopg2._psycopg' extension
       creating build/temp.linux-x86_64-3.9
       creating build/temp.linux-x86_64-3.9/psycopg
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_datetime.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_datetime.o -Wdeclaration-after-statement
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_list.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_list.o -Wdeclaration-after-statement
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_pboolean.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_pboolean.o -Wdeclaration-after-statement
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_pdecimal.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_pdecimal.o -Wdeclaration-after-statement
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_pfloat.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_pfloat.o -Wdeclaration-after-statement
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_pint.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_pint.o -Wdeclaration-after-statement
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/adapter_qstring.c -o build/temp.linux-x86_64-3.9/psycopg/adapter_qstring.o -Wdeclaration-after-statement
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/bytes_format.c -o build/temp.linux-x86_64-3.9/psycopg/bytes_format.o -Wdeclaration-after-statement
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/connection_int.c -o build/temp.linux-x86_64-3.9/psycopg/connection_int.o -Wdeclaration-after-statement
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/connection_type.c -o build/temp.linux-x86_64-3.9/psycopg/connection_type.o -Wdeclaration-after-statement
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/cursor_int.c -o build/temp.linux-x86_64-3.9/psycopg/cursor_int.o -Wdeclaration-after-statement
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/cursor_type.c -o build/temp.linux-x86_64-3.9/psycopg/cursor_type.o -Wdeclaration-after-statement
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -DHAVE_LO64=1 -I/app/.heroku/python/include/python3.9 -I. -I/usr/include/postgresql -I/usr/include/postgresql/13/server -c psycopg/diagnostics_type.c -o build/temp.linux-x86_64-3.9/psycopg/diagnostics_type.o -Wdeclaration-after-statement
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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
       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=130400 -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
       psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’:
       psycopg/psycopgmodule.c:685:18: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
         685 |     while (interp->next)
             |                  ^~
       error: command '/usr/bin/gcc' failed with exit code 1
       ----------------------------------------
   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-hzg6fcp3/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-hzg6fcp3/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-_cah6o9a/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/psycopg2 Check the logs for full command output.

! Push rejected, failed to compile Python app. ! Push failed

miguelgrinberg commented 3 years ago

The psycopg2 package fails to compile inside Heroku with current runtimes. Try replacing it with psycopg2-binary which does not require compilation from sources.

yehuihe commented 3 years ago

I'm not good at git but I changed requirements/heroku.txt psycopg2==2.7.3 to psycopg2-binary and git add and committed. But when build it continue to build with psycopg2==2.7.3. Thus same issue. What;s the right way?

miguelgrinberg commented 3 years ago

@yehuihe hard to know because you aren't providing the exact commands that you used. My guess is that you committed the change to the requirements file in one branch (or maybe as a detached commit) but then you are continue to push the same branch or tag as before to Heroku.

I'm not sure if these instructions will work for you exactly, because it depends on how you have your own code repository. Assuming you cloned this repository, then you could do it like this:

git checkout 17c  # get the clean version from this repo
git checkout -b my17c  # create a branch called "my17c"
... replace psycopg2 with psycopg2-binary in the requirements/heroku.txt file ...
git add requirements/heroku.txt
git commit -m "switch to psycopg2-binary"
git push heroku my17c  # push your branch to heroku
yehuihe commented 3 years ago

I did exactly what you said here and created branch my17c. After git push

(venv) yehui@ubuntu-yehui:~/Project/flasky$ git push heroku my17c Counting objects: 509, done. Delta compression using up to 8 threads. Compressing objects: 100% (253/253), done. Writing objects: 100% (509/509), 128.87 KiB | 64.43 MiB/s, done. Total 509 (delta 251), reused 492 (delta 241) remote: Pushed to branch other than [main, master], skipping build. To https://git.heroku.com/mighty-lowlands-86219.git

But heroku's Latest activity doesn;t have any changes at all. It didn't add a new build log. When i enter

(venv) yehui@ubuntu-yehui:~/Project/flasky$ git push heroku my17c Everything up-to-date

Nothing happened. No build. No Dyno. I'm struck here.

miguelgrinberg commented 3 years ago

I'm sorry, this was my mistake. The git push command is this:

git push my17c:master

You have to push the my17c branch to Heroku, but they expect the branch to come with the name master. Sorry about that.

If that gives you an error, then you can add -f to force the push.

yehuihe commented 3 years ago

Finally made it working! Still need to push to heroku

git push heroku my17c:master

One last question. What to do with my branch my17c? Cause in order to follow the book i still need to return to 17d tags. Also when i checkout 17d it shows:

(venv) yehui@ubuntu-yehui:~/Project/flasky$ git status HEAD detached at 17d Untracked files: (use "git add ..." to include in what will be committed)

    .idea/
    tmp/

nothing added to commit but untracked files present (use "git add" to track)

miguelgrinberg commented 3 years ago

The untracked files are files that you added that are not part of the repository. The .idea directory is added by PyCharm, and you probably created tmp maybe? Having untracked files is not really a problem, git is just letting you know that these files are not being included in source control, that's it.

When you checkout the 17d tag you will lose the changes that you put in your my17c branch. If you plan to push further updates to Heroku, you will need to make this change again.

As a side note, I think I'm going to make this change official and add it to this repository, because with current Heroku dynos that is the only way to get postgres to work.

yehuihe commented 3 years ago

Thank you very much. everything works fine.

A note: tmp/coverage with all the test coverage html files are generated by coverage . Pg. 223.