If you see "cannot import name 'ugettext_lazy'" in Django, Django 4.0 might be installed
Django
2021-12-11 13:51 (4 years ago)

When you run manage.py hoge in Django
ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/usr/lib/python3.8/site-packages/django/utils/translation/__init__.py)
If you encounter this error, it is possible that Django 4.0 is installed.
By the way, if you're installing dependencies with Pipenv in a Dockerfile, you can use the following commands:
COPY Pipfile /tmp/Pipfile
COPY Pipfile.lock /tmp/Pipfile.lock
...
RUN PIPENV_PIPFILE=/tmp/Pipfile pipenv install --system --ignore-pipfile --deploy
By adding the --ignore-pipfile option, the installation behavior will be similar to pipenv sync, which installs from the Pipfile.lock.
Please rate this article (No signup or login required)
Current rating: 2.5 (2)
Related posts
The Specified Version Was Not Installed with Pipenv
Upgrading to Django 3: from_db_value() missing 1 required positional argument: 'context' Error Occurs
After Updating Django, Migration Fails for oauth2_provider
Fix: pipenv install fails with AttributeError: module 'pkgutil' has no attribute 'ImpImporter' (Python 3.12)
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.
We look forward to discussing your development needs.