Custom Python Module Not Importing
I can't seem to get past this and do not quite understand what is happening. I have a directory with two class files in it. Using the REPL from within that directory I can import b
Solution 1:
The solution as I suspected was a pathing issue and more specifically in relation to how the modules interact once imported into the parent file, pagingsimulation.py.
So to resolve this issue it had nothing to do with __init__.py but rather how I was accessing page.py from within pagetable.py
So pagingsimulator.py uses,
import memory
And within memory, the init.py file has,
from .pagetableimportPageTable
For PageTable to access Page, the import statement had to be,
from memory importPage
It seems a bit funky to me and after failing so many times I would like to say there is a cleaner way to do this, but for the time being I'll take my win and hope that leaving this question here benefits someone else as I was unable to find something similar during my search.
Post a Comment for "Custom Python Module Not Importing"