Debugging NAB, Path to Module


Before going big with Stackoverflow, I hope you can help me.

I am debugging the HTM algorithm in NAB using Virtual Studio Code (VSC)
Supposing this is the (simplified) structure of the program:
   |- detectors
  1. If calls from nab.detectors.numenta_detector import XXX down the path, I don’t have any problem.
  2. but when imports a module from, it goes from nab.detectors.whatever import YYY. It starts from the RootFolder and does not find it.
  3. In changing to from whatever import YYY works

Since the hole program is written like in (2), and the issue pops up just by debugging, how can I overcome it?



How exactly are you running NAB? What command are you using? I’ve run NAB locally (and others have also) without having problems so it is probably something to do with your environment. Perhaps your PYTHONPATH should be append to include one of these folders?


As I said, NAB run smoothly, only by debugging the problem pops up.

The problem was for sure PYTHONPATH, here a way to solve the issue.
Anyway what really worked for me was an easy pip install -e ., which taking advantage of cleared the issue in Visual Studio Code and PyCharm.