I'm having difficulty specifying python path containing modules/packages in another directory or even folder of the same project. When I try to import I get the error:
ModuleNotFoundError: No module named 'perception'
In Spyder this is simply done using the UI to select an additional pythonpath that python will look in, but I am unable to do so in VSC.
Note I have tried following other answers on editing the settings.json files, and .env files but the problem still persists.
The only solution I have is to use sys.path.append() in every script which is not what I am looking for.
As an example my settings.json file is:
{
"terminal.integrated.env.osx": {
"PYTHONPATH": "pathtoprojectfolder"
},
"python.envFile": "${workspaceFolder}/.env",
"jupyter.interactiveWindowMode": "perFile",
"python.terminal.executeInFileDir": true,
"terminal.integrated.inheritEnv": true,
"jupyter.themeMatplotlibPlots": true,
"window.zoomLevel": 2,
"python.condaPath": "path_to_conda_python",
"python.defaultInterpreterPath": "path_to_conda_python",
}