I have a config.yaml
file that I want to import in my app.py
.
This is my folder structure:
/root
__init__.py
app.py
config.yaml
App.py:
import logging
import config
from flask import Flask
app = Flask(__name__)
logger = logging.getLogger(__name__)
app.run(port=5001)
I have no problem importing other Python modules (.py
) but when I try to import my YAML file, i get:
ImportError: No module named config
Does anyone know why this does not work? Do I need any dependencies to be able to import a YAML file like this?