Logo Microtux


How to resolve ‘Import “django.contrib” error


How to resolve ‘Import “django.contrib” error. could not be resolved from source Pylance report Missing Module Source’?


Select the python interpreter in which u have created the virtual environment. Select on the (in Visual Studio Code) bottom left side the python interpreter, o use keys Ctrl+Shift+P. Select in the upcoming menu +Enter interpreter path Point to your virtual environment and select the bin map. Then point to the python interpreter you have installed there. (In my case virtual/bin/python3)
If it is OK you see in the editor: python version. example-> 3.8.10(‘virtual’:venv)