I use VS Code Version: 1.74.3 on MacOS 13.2. python -V
returns Python 3.11.1
.
I get the following error message: Import "django.shortcuts" could not be resolved from source Pylance(reportMissingModuleScource)
.
As you can see in the screenshot, the correct venv
is activated and includes Django
.
I also tried or checked:
- Import could not be resolved/could not be resolved from source Pylance in VS Code using Python 3.9.2 on Windows 10
- https://stackoverflow.com/a/65802367/2321643 but
- the suggested solution with reloading the windows did not help.
- reinstallation the virtual environment within VSCode and installing Django again
- re-selecting the venv.
- deleting all python-specific settings in
user/settings.json
as well as.vcode/settings.json
. - Reinstallation python and associated extensions.
Using Debug I can safely run my Django-application without any import issues. What do I need to do that Pylance does not issues these problems?