Getting Error while executing run.py file

Hi,
Matt, I am facing the following error. Please check and let me know what I am doing wrong:

(mflix) D:\DATA\Personal\DEV\MongoDB\MongoDB_University\M220\mflix-python>py run
.py
Traceback (most recent call last):
File “run.py”, line 1, in
from mflix.factory import create_app
File “D:\DATA\Personal\DEV\MongoDB\MongoDB_University\M220\mflix-python\mflix
factory.py”, line 3, in
from flask import Flask, render_template
ModuleNotFoundError: No module named ‘flask’

Also, while installing the requirements I have got following error. Please let me know what needs to be done for the same:

ERROR: notebook 6.0.1 has requirement jupyter-client>=5.3.1, but you’ll have jup
yter-client 5.2.4 which is incompatible.
Installing collected packages: jupyter-client
Found existing installation: jupyter-client 5.3.4
Uninstalling jupyter-client-5.3.4:
Successfully uninstalled jupyter-client-5.3.4
Successfully installed jupyter-client-5.2.4

To solve the below error,

ERROR: notebook 6.0.1 has requirement jupyter-client>=5.3.1, but you’ll have jup
yter-client 5.2.4 which is incompatible.
Installing collected packages: jupyter-client
Found existing installation: jupyter-client 5.3.4
Uninstalling jupyter-client-5.3.4:
Successfully uninstalled jupyter-client-5.3.4
Successfully installed jupyter-client-5.2.4

I have edited, the requirements.txt file and updated the below fields:

jupyter-client==5.3.4
jupyter-console==6.0.0
jupyter-core==4.6.0

After that whole Installation got successful
but still below problem is there. Please suggest, the solution for the same:

(mflix) D:\DATA\Personal\DEV\MongoDB\MongoDB_University\M220\mflix-python>py run
.py
Traceback (most recent call last):
File “run.py”, line 1, in
from mflix.factory import create_app
File “D:\DATA\Personal\DEV\MongoDB\MongoDB_University\M220\mflix-python\mflix
factory.py”, line 3, in
from flask import Flask, render_template
ModuleNotFoundError: No module named ‘flask’

Please check this link.It may help

Error on running Run.py (No module named ‘flask’)

Hi @Manish_04653,

Let me know if you are still facing the issue.

Kanika

Hi, kanika that issue has been solved as have not installed the vitual path in the folder named mflix-python I have installed the same and it is fixed but now I am getting the following error:

(mflix_venv) D:\DATA\Personal\DEV\MongoDB\MongoDB_University\M220\mflix-python>p
ython run.py
Traceback (most recent call last):
File “run.py”, line 13, in
app.config[‘MFLIX_DB_URI’] = config[‘PROD’][‘MFLIX_DB_URI’]
File “C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\Lib\con
figparser.py”, line 960, in getitem
raise KeyError(key)
KeyError: ‘PROD’

I have already checked the URI. It is correct in dotini file. Please let me know what needs to be done.

It is resolved now. Actually I have renamed the dotini_win file as dotini_win.ini instead of .ini due to which the production key was not getting found. Now I have rename it to .ini and then executed python run.py .It is opened the localhost at https://127.0.0.1:5000.

Thanks for the support.

1 Like