My project has two main folders: sourceCode
and lib
: Highlighted file tree here
I'm working in \sourceCode\mainFile.ipynb
and would like to import a library residing in lib
called modifiedLibrary
, which has an __init__.py
file.
Currently, I'm using a symbolic link for relative-importing the library. The symbolic link is located in \sourceCode
and called sym_link
with the following content:
../lib/modifiedLibrary/modifiedLibrary
In the project, the library and the symbolic link have the same name.
but when I import in python using
import modifiedLibrary
I receive ModuleNotFoundError: No module named 'modifiedLibrary'
I understand that the same code functions on another device that I do not have access to right now, and I do not seem to find what the issue is.
I successfully included the needed library by:
- changing the working directory temporarily to where the library's
__init__.py
is located, - importing the library
- then reverting back to my original directory
but I would like to know what the issue is with the current symbolic link.
Windows 10 / Python 3.7.3 / Jupyter
Relevant Question: Interactive Python - solutions for relative imports