擅长:python、mysql、java
<p>我发现这个链接告诉我们应该添加一个额外的路径</p>
<blockquote>
<p>These extra roots must be specified to the language server. The
easiest way to do this (with the VS Code Python extension) is to
create a workspace configuration which sets
python.analysis.extraPaths. For example, if a project uses a sources
directory, then create a file .vscode / settings.json in the workspace
with the contents:</p>
</blockquote>
<pre><code>{
"python.analysis.extraPaths": ["./sources"]
}
</code></pre>
<p><a href="https://github.com/microsoft/pylance-release/blob/master/TROUBLESHOOTING.md#unresolved-import-warnings" rel="noreferrer">https://github.com/microsoft/pylance-release/blob/master/TROUBLESHOOTING.md#unresolved-import-warnings</a></p>