Search code examples
pythondjangopipimporterrorweblate

Installing weblate 2.3: from django.db.models.sql.aggregates ImportError: No module named aggregates


While installing weblate 2.3 (older version), I had the following error:

File "/srv/weblate/weblate/trans/boolean_sum.py", line 27, in from django.db.models.sql.aggregates import Sum as BaseSQLSum ImportError: No module named aggregates


Solution

  • I took a look at my django version, and it was the latest one, which doesn't have a aggregates.py in django/db/models/sql/. I took a look at weblate 2.3 's requirements.txt and it contains the following line:

    Django>=1.7
    

    This was installing 1.10. I changed the line to

    Django==1.7
    

    Installed the right version with pip and now everything works as expected.
    Hope it helps someone else. :)

    Similar problem could also happen in weblate 2.7 and higher as their requirements.txt still uses >= on master and on weblate-2.7 tag.