Import local function from a module housed in another directory with relative imports in Jupyter Notebook using Python 3

I have a directory structure similar to the following meta_project project1 __init__.py lib module.py __init__.py notebook_folder notebook.jpynb When working in notebook.jpynb if I try to use a relative import to access a function function() in module.py with: from ..project1.lib.module import function I get the following error: SystemError Traceback (most recent call last) <ipython-input-7-6393744d93ab> in <module>() … Read more

Relative imports – ModuleNotFoundError: No module named x

This is the first time I’ve really sat down and tried python 3, and seem to be failing miserably. I have the following two files: test.py config.py config.py has a few functions defined in it as well as a few variables. I’ve stripped it down to the following: config.py debug = True test.py import config … Read more

Relative imports for the billionth time

I’ve been here: http://www.python.org/dev/peps/pep-0328/ http://docs.python.org/2/tutorial/modules.html#packages Python packages: relative imports python relative import example code does not work Relative imports in python 2.5 Relative imports in Python Python: Disabling relative import and plenty of URLs that I did not copy, some on SO, some on other sites, back when I thought I’d have the solution quickly. … Read more