Trying to wrap my head around changes in import python2 to python3
by computersavvy from LinuxQuestions.org on (#5EJTP)
I have a small app written in python2 (works in 2.7) that I am trying to convert to python3. My version is 3.9.
The main part of the app is in one directory and there are additional modules nested one directory below. The sub-directory is named db. and contains modules Table.py, Column.py, etc.
So the relative path is db/Table.py etc.
The python2 syntax to import all the modules in the lower directory is "import db"
Python3 however gives me an error
Code: import db
ModuleNotFoundError: No module named 'db'I have searched through the changes and been unable to identify the correct way to restate the import for those modules.
Any suggestions on how to state that for successful import, or where to look for better info than I have located so far.?


The main part of the app is in one directory and there are additional modules nested one directory below. The sub-directory is named db. and contains modules Table.py, Column.py, etc.
So the relative path is db/Table.py etc.
The python2 syntax to import all the modules in the lower directory is "import db"
Python3 however gives me an error
Code: import db
ModuleNotFoundError: No module named 'db'I have searched through the changes and been unable to identify the correct way to restate the import for those modules.
Any suggestions on how to state that for successful import, or where to look for better info than I have located so far.?