I have a Flask project with this structure:
folderA/
__init__.py
subfolderA/
__init__.py
file.py
run.py
db.py
and in file.py I have this import: from folderA.db import method
when I run this app with “flask –app run –debug run”, the application starts with no problems. However when I try to start the project with another hosting server technique (I’m using Waitress for example) I get the following error: “No module named ‘folderA'”.
I even tried and ran the python file directly with py run.py
(Within the folderA directory) I still get the same error.
My problem is that, why python interpreter does not understand that there is a init.py file in folderA, and why it does not recognise that folderA is a package?
Thanks for your help in advance.
Mohammad Javad Salehi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.