vscode import error for python module

后端 未结 9 1971
栀梦
栀梦 2020-12-02 20:26

I am trying to do an import in python from one directory level up.

import sys

sys.path.append(\'..\')
from cn_modules import exception

I g

9条回答
  •  一向
    一向 (楼主)
    2020-12-02 21:06

    Thanks Honza Kalfus jankalfus

    I have noticed that if I use File -> Close folder and then File -> Open Folder... and open the project folder again, the errors are gone. If I just restart VS Code instead, I keep getting the errors. I presume that some internal cache gets cleared?

    Found here https://github.com/Microsoft/vscode/issues/10391

提交回复
热议问题