This message was deleted.
# ask-anything
s
This message was deleted.
e
try setting:
Copy code
class: TaskRunner
this way you don't need the output notebook docs: https://docs.ploomber.io/en/latest/api/_modules/tasks/ploomber.tasks.ScriptRunner.html#ploomber-tasks-scriptrunner let me know if this fixes it!
should work with .py and .ipynb
n
Thanks! Works perfectly with
class: ScriptRunner
πŸ‘ 1
Peculiar behaviour. When I use
class: ScriptRunner
, the python files can not import files from another directory. This behaviour is not observed with the default NotebookRunner
e
importing python files?
n
yes, example:
from common.lib import base64
and I get
ModuleNotFoundError: No module named 'common'
common being a different directory in the project tree
e
ok so a quick fix would be to modify the top cell and add the directory to sys.path. but im surprised that it works on notebookrunner. how is your notebook relative to the common.py? for notebookrunner to find it, it should be in the same directory or in the sys.path
n
The tree is like . └── project/ β”œβ”€β”€ common/ β”‚ └── lib β”œβ”€β”€ file1.py --> want to import common.lib here β”œβ”€β”€ file2.py └── pipeline.yaml
e
Ok so they’re at the same level. I think the error is that notebook runner is not adding the directory to the path. Can you add it manually? Modify sys.path and add project/ if that fixes it, please let me know
n
Yes, this works after updating the sys.path
e
great! can you open an issue on github ?
e
thanks!