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

ImportError: cannot import name 'ugettext_lazy' #170

Open
stromal opened this issue Jul 28, 2022 · 2 comments
Open

ImportError: cannot import name 'ugettext_lazy' #170

stromal opened this issue Jul 28, 2022 · 2 comments
Labels

Comments

@stromal
Copy link

stromal commented Jul 28, 2022

Describe the bug

CODE 1

pip install virtualenv
virtualenv mysiteenv
source mysiteenv/bin/activate
pip install pinax-cli
pinax start account mysite

cd mysite
npm install  
pip install -r requirements.txt
./manage.py migrate

ERROR Message 1

Traceback (most recent call last):
  File "/Users/my_username/myfolder/./manage.py", line 12, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/my_username/myfolder/lib/python3.9/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "/Users/my_username/myfolder/lib/python3.9/site-packages/django/core/management/__init__.py", line 420, in execute
    django.setup()
  File "/Users/my_username/myfolder/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/my_username/myfolder/lib/python3.9/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/Users/my_username/myfolder/lib/python3.9/site-packages/django/apps/config.py", line 126, in create
    mod = import_module(mod_path)
  File "/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/my_username/myfolder/lib/python3.9/site-packages/pinax/templates/apps.py", line 2, in <module>
    from django.utils.translation import ugettext_lazy as _
ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/Users/my_username/myfolder/lib/python3.9/site-packages/django/utils/translation/__init__.py)

Tried to resolve the issue

  • remove the ‘u’ from ’ugettext_lazy’ -> NOT IN: python3.9/site-packages/django/utils/translation/init.py)

Expected behavior

  • Run without an error

Desktop

  • OS: [MacOS 12.5, M1]
  • django-admin --version -> 4.0.6
  • python 3.9
@stromal stromal added the bug label Jul 28, 2022
@Ded090
Copy link

Ded090 commented Dec 11, 2022

I agree with you bro this fucking shit fuck my brain for 2 hours.I cut this shit from my project and that now work.I think delete this shit from world.Do you accept my idea?

@Wali-Muhammad123
Copy link

Hi, Can I solve this issue?

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

No branches or pull requests

3 participants