I have seen this question asked in numerous other posts, but none of the answers seem to work for my situation using Python 3. I have a simple repository I am working in; call it my workspace, named my_repo
with 3 folder levels for various projects. I wanted to create a utils folder with utility modules I could call in other scripts or notebooks. It has the following file structure:
my_repo
|
├── notebooks
| |
| └--myNotebook.ipynb
|
|
└── Scripts
| |
| └--myScript.py
|
└── Utils
|--download_stuff.py
| |
| └--download_data()
|
|--upload_stuff.py
| |
| └--upload_data()
|
L--translate_stuff.py
|
└--translate_data()
Using myNotebook.ipynb
as an example, I have tried various means to import the module download_stuff.py
and the function download_data()
into my code. Here is my most recent try:
import sys
from ..utils.get_src_datasets import download_data()
This returns ImportError: attempted relative import with no known parent package
What would be the simplest way to import this module into my other scripts and notebooks in my workspace