Skip to content

ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/usr/local/lib/python3.11/site-packages/django/utils/translation/__init__.py) #445

@s2tu

Description

@s2tu

In Django 4.0 + the package ugettext_lazy is deprecated. I was facing a issue similar to the below article. I had to make the same change in the following file:

/usr/local/lib/python3.11/site-packages/django/utils/translation/init.py

https://edwinodhiambo.medium.com/importerror-cannot-import-name-ugettext-lazy-from-django-utils-translation-d1788e17cb11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions