update flask project from python2 to python3 update flask project from python2 to python3 flask flask

update flask project from python2 to python3


You are using implicit relative imports (the Python 2 model); you need to use absolute references or explicit relative imports:

from .app1.app1 import mod as app1

where the leading . signals that the rest is relative to the current package, or

from app.app1.app1 import mod as app1

See PEP 328 - Imports: Multi-Line and Absolute/Relative.

You probably will have other issues however. Porting is not that trivial, read up on the issues in the Porting to Python 3 book. This issue is a common migration problem.