I have a Python/Django app which uses Pipfile
and Pipfile.lock
running on Heroku-22 stack with classic buildpacks.
requirements.txt
is not part of the code base, thus e.g. Heroku: ModuleNotFoundError :No module named 'requests' and similar issues are not relevant.
Pipfile
and Pipfile.lock
contain psycopg2
(not psycopg2-binary
). Testing env has expected packages installed, however, production env has an extra package, psycopg
, installed.
$ heroku run bash -a my-app-production
~ $ pip freeze | grep -i psyco
psycopg==3.2.4
psycopg2==2.9.10
vs
$ heroku run bash -a my-app-testing
~ $ pip freeze | grep -i psyco
psycopg2==2.9.10
Testing and production envs are the same with one exception - server side Pgbouncer runs on production. Pgbouncer () lists psycopg
as one of its dependencies. Though according to Heroku' docs, Pgbouncer's connection pool exists on the database server, not on app' dyno.
Also, installing app' dependencies locally in a Docker container with pipenv install --deploy
(Heroku runs the same command) works as expected.
Any idea where is this extra psycopg
package coming from? Is it installed because of Pgbouncer (unlikely, in my opinion)?