Q:

Application says module not found after moving to directory

I'm rather new to python and have this odd issue, which I can't seem to find an answer for. 
When both app.py and mod_db were in the root directory, it works but when I shifted them to a sub directory
My directory structure:
demo_api
|
|-- demo-api
    |
    |-- __init__.py
    |-- app.py
    |-- mod_db.py

My main module
import json

from flask import Flask, request, Response
from .db_mod import insert_and_score

app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello World!' 

@app.route('/emotional_scoring', methods=['POST'])
def get_scoring():
    json_obj = request.json
    ret_json = insert_and_score(json_obj)
    resp = Response(json.dumps(ret_json), mimetype='application/json', status=200)
    return resp

if __name__ == '__main__':
    app.run(host='0.0.0.0', debug=False)

The error message is on this line
from .mod_db import insert_and_score

I've tried change the sub-directory name.  I've tried doing a full path, i.e. from demo_app.mod_db import insert_and_score and the error is ModuleNotFoundError: No module named 'demo_app'
The issue is that it works find in my IDE (PyCharm) but when I do it on command line, these are the errors I encounter. 

A:

As stated by mfrackowiak, I just had to change it to
from db_mod import insert_and_score

and it worked.  But PyCharm doesn't like this.  So I think it might be a PyCharm issue.