How to import python modules in a notebook?

bi123
New Contributor

I have a job with a notebook task that utilizes python modules in another folder than the notebook itself. When I try to import the module in the notebook, it raises module not found error. I solved the problem using sys.pathimage.png

But I am curious if there is a more elegant approach to handle this, maybe to set a root path for the notebook task in the yaml configuration?