VSCode警告 Import “package“ could not be resolved

VSCode警告 Import “package” could not be resolved

Pylance插件报告缺少的引入

解决方案

Ctrl+Shift+P打开命令面板,输入settings,选择Preferences: Open Settings(JSON)
VSCode警告 Import “package“ could not be resolved_第1张图片
添加"python.pythonPath": "Your python path",加入python.exe路径
VSCode警告 Import “package“ could not be resolved_第2张图片
保存,重新打开VSCode即可

你可能感兴趣的:(错误记录,python,bug)