As you can see in image below, thread_processor and order_processor is in the same folder as main.py, yet it does not recognize as a module.
Its is looking only at the root folder ..
even adding below code in launch.json is not helping either … THanks
{
"configurations": [
{
"name": "Python",
"type": "python",
"stopOnEntry": false,
"request": "launch",
"pythonPath": "${config.python.pythonPath}",
"program": "${file}",
"cwd": "${workspaceRoot}",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
],
"env": {
"PYTHONPATH": "/src/order_processing_engine"
}
}
]
}
2
Answers
Add your folder in extraPaths as below
Since your folder is a package, you can use a relative import. E.g.,
from .thread_extractor import get_next_thread