Yaroslav Hladkyi
Yaroslav Hladkyi

Reputation: 335

Importing Python modules to Jupyter notebook

I have got the next hierarchy:

project_name
|-utils
| |-lib
|   |-module.py
|-notebooks
| |-nb.ipynb

How can I import module.py to the np.ipynb?

Upvotes: 3

Views: 175

Answers (1)

Kiprono Elijah Koech
Kiprono Elijah Koech

Reputation: 338

Use sys package as follows on nb.ipynb

import sys
sys.path.insert(0,"/path/to/module.py")

Upvotes: 1

Related Questions