Heroku does not install module psycopg2 even if it's on the requirements.txt file

Viewed 55

I'm trying to deploy a python + flask + postgres app to heroku, but after deploying I get a

2020-09-11T15:11:45.278473+00:00 app[web.1]: dbapi = dialect_cls.dbapi(**dbapi_args)
2020-09-11T15:11:45.278474+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 753, in dbapi
2020-09-11T15:11:45.278474+00:00 app[web.1]: import psycopg2
2020-09-11T15:11:45.278475+00:00 app[web.1]: ModuleNotFoundError: No module named 'psycopg2'

And this is the build log

-----> Python app detected

-----> No change in requirements detected, installing from cache

-----> Installing pip 9.0.2, setuptools 47.1.1 and wheel 0.34.2

       Skipping installation, as Pipfile.lock hasn't changed since last deploy.

-----> Installing SQLite3

-----> Discovering process types

       Procfile declares types -> web

-----> Compressing...

       Done: 84M

-----> Launching...

       Released v35

I have no idea where the SQLite3 module is coming from.

This is the requirements.txt. I tried with the psycopg2==2.8.6 only, with psycopg2-binary==2.8.6 only, and with both, nothing seems to work.

Anyone have any suggestions?

alembic==1.4.2
astroid==2.4.2
click==7.1.2
colorama==0.4.3
dnspython==2.0.0
email-validator==1.1.1
flake8==3.8.3
Flask==1.1.2
Flask-Login==0.5.0
Flask-Migrate==2.5.3
Flask-SQLAlchemy==2.4.4
Flask-WTF==0.14.3
gunicorn==20.0.4
idna==2.10
isort==5.5.2
itsdangerous==1.1.0
Jinja2==2.11.2
lazy-object-proxy==1.4.3
Mako==1.1.3
MarkupSafe==1.1.1
mccabe==0.6.1
protobuf==3.13.0
psycopg2==2.8.6
psycopg2-binary==2.8.6
pycodestyle==2.6.0
pyflakes==2.2.0
pylint==2.6.0
pylint-flask==0.6
pylint-flask-sqlalchemy==0.2.0
pylint-plugin-utils==0.6
python-dateutil==2.8.1
python-dotenv==0.14.0
python-editor==1.0.4
six==1.15.0
SQLAlchemy==1.3.19
toml==0.10.1
Werkzeug==1.0.1
wrapt==1.12.1
WTForms==2.3.3
0 Answers
Related