Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
import workspace2 workspace2.a_func()
这可以工作并且运行得很好,但是它强调workspace2为未解决并且使函数没有颜色。
workspace2
添加
"python.analysis.extraPaths": ["${workspaceFolder}/python"],
在 settings.json 文件中。
您可以参考这里了解更多详情
我通过意识到我安装了两个版本的 Python 3 来解决它。我卸载了旧版本,现在它可以很好地找到任何模块的目录。
您可以通过打开命令提示符并键入 py -0 然后从控制面板卸载来检查 Windows 中的 python 版本。