I am using pythonnet and clr to import a C# .DLL
Folder structure is like this:
|-- project
|-- foo.py
|-- folderWithDll
|-- Common.Dll
|-- example.py
If I am running cmd from the \\project folder, this will work:
from folderWithDll.example import *
But when I try this:
import clr
from folderWithDll.Common.APIs import *
I am met with the following error:
ModuleNotFoundError: No module named 'folderWithDll.Common'
However if I add folderWithDll to the path with:
sys.path.insert(0, os.getcwd()+'\\folderWithDll')
Then I can just do this and it will work:
from Common.APIs import *
Why can I not import the DLL unless I have its parent folder added to sys.path?
Thank you!