Search code examples
pythondjangovisual-studio-codemoduledirectory

Django Directory was not same in VSCode


from django.utils.translation import ugettext_lazy

I got problem in this line for last 2 hours I try every method but failed, but when I checked the directory of django.utils.translation is someone else and directory of ugettext_lazy has someone else meanwhile django.utils.translation search ugettext_lazy in C:\Users\admin\AppData\Local\Programs\Python\Python310\Lib\site-packages\django\utils\translation_init_.py

but the ugettext_lazy directory has in C:\Users\admin\.vscode\extensions\ms-python.python-2022.4.0\pythonFiles\lib\jedilsp\jedi\third_party\django-stubs\django-stubs\utils_init_.py

How to make it same directory

enter image description here

enter image description here


Solution

  • I got it there is two simple method to do that one is

    copy that line or function or class from other directory and paste it to the directory where he finds that

    Second is

    use * after 'import' for example

    from django.utils.translation import *