Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer used libary -ugettext_lazy change to gettext_lazy as _ #87

Open
alexiokay opened this issue Mar 4, 2022 · 5 comments
Open

Comments

@alexiokay
Copy link

alexiokay commented Mar 4, 2022

I've changed all ugettext_lazy as _ to gettext_lazy as _ and it working, but I have problem when deploying app on heroku..

from django.utils.translation import ugettext_lazy as _
remote: ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/app/.heroku/python/lib/python3.10/site-packages/django/utils/translation/init.py)

@lucbran
Copy link

lucbran commented Mar 18, 2022

Having same issue when deploying to Heroku now.. Django 3.3 involved..

@drobb2020
Copy link

Hello, I'm seeing the same issue with Python 3.9/Django 4.0.4:

from django.utils.translation import ugettext_lazy as _
ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/Users/davidrobb/Development/python/david_robb/django-demo-blog/venv/lib/python3.9/site-packages/django/utils/translation/init.py)

@damilareonifade
Copy link

I am seeing this same issues with Python 3.9/Django4.0
from django.utils.translation import ugettext_lazy as _
ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/Users/davidrobb/Development/python/david_robb/django-demo-blog/venv/lib/python3.9/site-packages/django/utils/translation/init.py)
I think an upgrade neds to be done on the code before some modules import name has been changed

@Carewen
Copy link

Carewen commented Jul 2, 2022

I am seeing this same issues with Python 3.9/Django4.0 from django.utils.translation import ugettext_lazy as _ ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/Users/davidrobb/Development/python/david_robb/django-demo-blog/venv/lib/python3.9/site-packages/django/utils/translation/init.py) I think an upgrade neds to be done on the code before some modules import name has been changed

I am having the same issue on Django 4.0/Python 3.10.

@scopalaffairs
Copy link

scopalaffairs commented Jul 19, 2022

ugettext_lazy was deprecated in v2.2 and is no longer used in django v3+.
See: https://forum.djangoproject.com/t/importerror-cannot-import-name-ugettext-lazy-from-django-utils-translation/10943

@dmpayton apparently updated the source 7 months ago to fix this, but did not draft a new release. I am going to try and pull from latest dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants