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
I tried to add this in my launch.json, then it works!
"env": {"PYTHONPATH": "${workspaceRoot}"}
below is my launch.json
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"cwd": "${workspaceRoot}",
"env": {"PYTHONPATH": "${workspaceRoot}"},
"console": "integratedTerminal"
wish it can help u! :)