最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

django - Heroku installs extra Python package - Stack Overflow

programmeradmin0浏览0评论

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)?

发布评论

评论列表(0)

  1. 暂无评论