VS Code导入Python模块“ ModuleNotFoundError”

时间:2020-07-21 16:04:07

标签: python

我正在使用VS Code在Python中进行编码。每当我尝试从相对路径导入Python模块时,都会出现上述错误。文件夹路径没有问题。我已经尝试过在Pycharm中导入相对路径,并且效果很好。

我读了几篇关于一年前VScode中发生类似错误的文章。有人知道解决方案吗?

from folder1.python1 import hello
hello() # Simply should print "hello"


ModuleNotFoundError: No module named 'folder1'

路径folder1.python1会被自动理解。

0 个答案:

没有答案