Importing custom module into jupyter notebook

后端 未结 7 1989
眼角桃花
眼角桃花 2021-02-05 05:55

Yes, I know this is a recurrent question but I still couldn\'t find a convincing answer. I even read at https://chrisyeh96.github.io/2017/08/08/definitive-guide-python-imports.h

7条回答
  •  抹茶落季
    2021-02-05 06:15

    I think you need a __init__.py module in the notebooks/ directory. I haven't really used Jupyter notebooks before so I could be wrong. You may also need to try changing your import statement to:

    import .. helpers
    

    to indicate that the import statement is for a local package that is located in the parent directory of the Jupyter notebook.

提交回复
热议问题