You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I made a deployment today, I've noticed that deployment failed due to a requirement in Django Postgres Stats. This failure is related to a recent change in the psycopg2 Python package.
So, I would suggest to change that one line in the requirements.txt to: psycopg2-binary>=2.7.3.2
While inconvenient to force an update of the psycopg2 package, given that 2.7.3.2 was released on 24 October 2017 (http://initd.org/psycopg/articles/2017/10/24/psycopg-2732-released/), the change should probably not be a big problem for most actively maintained applications.
When I made a deployment today, I've noticed that deployment failed due to a requirement in Django Postgres Stats. This failure is related to a recent change in the
psycopg2
Python package.Background
Until release 2.8, the
psycopg2
package installed the binary package by default. However, this behaviour has now been changed and from release 2.8 on, there is a separate binary package available namedpsycopg2-binary
which should be used instead (see also the "What's new in psycopg 2.8" section in https://github.com/psycopg/psycopg2/blob/master/NEWS or on http://initd.org/psycopg/articles/2019/04/04/psycopg-28-released/).While this change has been communicated for a while, it only became a problem with the actual release of 2.8 on 4 Apr 2019.
Solution
Currently, the Django Postgres Stats
requirements.txt
(https://github.com/rtidatascience/django-postgres-stats/blob/master/requirements.txt#L2) listspsycopg2>=2.6.1
as dependency. Unfortunately, this version isn't available aspsycopg2-binary
package, the first release with the new name is 2.7.3.2 (see also https://pypi.org/project/psycopg2-binary/#history).So, I would suggest to change that one line in the
requirements.txt
to:psycopg2-binary>=2.7.3.2
While inconvenient to force an update of the
psycopg2
package, given that 2.7.3.2 was released on 24 October 2017 (http://initd.org/psycopg/articles/2017/10/24/psycopg-2732-released/), the change should probably not be a big problem for most actively maintained applications.Side note
For my own application, I could simply remove the dependency on
django-postgres-stats
entirely, since everything we currently use is supported by Django 2.0 natively (EXTRACT
forDurationField
was the last bit that was missing until 2.0, see also https://docs.djangoproject.com/en/2.1/ref/models/database-functions/#django.db.models.functions.Extract).Kind regards,
Goetz
The text was updated successfully, but these errors were encountered: