ml-powered-applications icon indicating copy to clipboard operation
ml-powered-applications copied to clipboard

can't run FLASK_APP=app.py flask run

Open xingvoong opened this issue 1 year ago • 1 comments

Try 'flask run --help' for help.

Error: While importing 'app', an ImportError was raised:

Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/flask/cli.py", line 218, in locate_app import(module_name) File "/Users/xingvoong/github/ml-study/ml-powered-applications/app.py", line 5, in from ml_editor.ml_editor import get_recommendations_from_input File "/Users/xingvoong/github/ml-study/ml-powered-applications/ml_editor/ml_editor.py", line 5, in import pyphen ModuleNotFoundError: No module named 'pyphen'

I already install pyphen.

xingvoong avatar Jan 02 '24 21:01 xingvoong

At a glance, this sounds like an environment issue, I'd try two things.

Double check that pyphen is actually installed. Open a Python shell and try import pyphen. If it fails here, then it is not installed properly. Reinstall it with pip install pyphen.

If pyphen is installed, make sure it is installed in the same environment/Python installation that you are using to run the Flask app. For example if you installed pyphen in a virtualenv or conda environment, make sure to activate that environment before running flask run.

Let me know if this fixed your issue

hundredblocks avatar Jan 03 '24 00:01 hundredblocks