Home > Back-end >  Django Directory was not same in VSCode
Django Directory was not same in VSCode

Time:04-06

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

CodePudding user response:

The i at the end of the files extension means that the file is an interface you can read more enter image description here

As shown in the picture, in fact, vscode has told us that the imported file here is already a wrong file, and it is not included in this package. As mentioned above, you could use "*" if you can't ensure the content to import.

  • Related