I am building a Flask application with Python 3.5 after the tutorial based on different import rules. If I look for similar questions, I managed to solve ImportError based on import from a subfolder, adding a folder to the path, but I continue to refuse when importing a function from a script in the same folder (already on the way), The folder structure is as follows:
DoubleDibz
βββ app
β βββ __init__.py
β βββ api
β β βββ __init__.py
β β βββ helloworld.py
β βββ app.py
β βββ common
β β βββ __init__.py
β β βββ constants.py
β βββ config.py
β βββ extensions.py
β βββ static
β βββ templates
βββ run.py
In app.py, I import the function from config.py with this code:
import config as Config
but I get this error:
ImportError: No module named 'config'
I do not understand what the problem is, being two files in the same folder. thanks in advance
source
share