I get the following error when trying to import from src package:
client.py
from . import create_app
from . models import db
from . models import Monitoring
app = create_app()
init.py
from flask import Flask
from . models import db
app = Flask(__name__)
def create_app():
db.init_app(app)
return app
from src import routes
Project tree
.
├── manage.py
├── sf.py
├── src
│ ├── client.py
│ ├── __init__.py
│ ├── models.py
│ └── routes.py
└── tests
├── __init__.py
├── test.py
Error message:
(sensor_flora) edx@edx-HP-250-G3-Notebook-PC:~/VisualStudio/SensorFlora$ python src/client.py
Traceback (most recent call last):
File "src/client.py", line 4, in <module>
from . import create_app
ImportError: attempted relative import with no known parent package