When I was building the development environment for django, I was addicted to the following events.
It's my environment.
The code works even if there is an error, but if the quick fix does not work, the work efficiency will drop and the error will be unpleasant. I want to erase it.
As a result of investigation, it was because VS Code could not find the target module. The error can be resolved by adding the search path of the target module to the setting item of Pylance.
If you press shift + cmd + P
and search for" settings ", it will be suggested.
Add _ ** python.analysis.extraPaths ** _ and describe the full path of the module to be searched.
settings.json
"python.analysis.extraPaths": [
//Django library storage directory
"/Users/user_name/.pyenv/versions/3.9.0/lib/python3.9/site-packages",
//Project root directory
"/Users/user_name/workspace/project_name",
],
The error has been resolved and code jumps and quick fixes are now enabled.