Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-03-2022 08:02 AM
flask run executes successfully, but when I go to localhost:3000, I get
flask.cli.NoAppException: While importing "api", an ImportError was raised: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/flask/cli.py", line 240, in locate_app __import__(module_name) File "/Users/irene221b/Documents/GitHub/app-python/api/__init__.py", line 7, in <module> from flask_jwt import JWT ModuleNotFoundError: No module named 'flask_jwt'
It installed successfully with all the requirements:
pip install flask_jwt
Requirement already satisfied: flask_jwt in /Users/irene221b/sandbox/lib/python3.9/site-packages (0.3.2)
Requirement already satisfied: Flask>=0.9 in /Users/irene221b/sandbox/lib/python3.9/site-packages (from flask_jwt) (2.0.2)
Requirement already satisfied: PyJWT<1.5.0,>=1.4.0 in /Users/irene221b/sandbox/lib/python3.9/site-packages (from flask_jwt) (1.4.2)
Requirement already satisfied: Werkzeug>=2.0 in /Users/irene221b/sandbox/lib/python3.9/site-packages (from Flask>=0.9->flask_jwt) (2.0.2)
Requirement already satisfied: itsdangerous>=2.0 in /Users/irene221b/sandbox/lib/python3.9/site-packages (from Flask>=0.9->flask_jwt) (2.0.1)
Requirement already satisfied: click>=7.1.2 in /Users/irene221b/sandbox/lib/python3.9/site-packages (from Flask>=0.9->flask_jwt) (8.0.3)
Requirement already satisfied: Jinja2>=3.0 in /Users/irene221b/sandbox/lib/python3.9/site-packages (from Flask>=0.9->flask_jwt) (3.0.3)
Requirement already satisfied: MarkupSafe>=2.0 in /Users/irene221b/sandbox/lib/python3.9/site-packages (from Jinja2>=3.0->Flask>=0.9->flask_jwt) (2.0.1)
08-04-2022 04:02 AM
Hi Irene,
Can you trying `PYTHONPATH=. flask run` and let me know if that fixes the issue?
08-05-2022 08:41 AM
No, it didn't, sorry.
08-10-2022 07:02 AM - edited 08-10-2022 07:06 AM
👋 what does pip --version
report? This might be a long shot but maybe you're using pip that belongs to Python 2 or another Python version than the one used to run the flask app.
Actually, looking closer at your stack traces (🙌 thanks for providing them), it looks like this is the case.File "/usr/local/lib/python3.9/site-packages/flask/cli.py", line 240, in locate_app
looks like flask is run from the global Python interpreter, while Requirement already satisfied: flask_jwt in /Users/irene221b/sandbox/lib/python3.9/site-packages (0.3.2)
suggests that pip is run within the sandbox (virtualenv, I guess?).
So try to start the app with python -m flask ...
instead of flask ...
09-26-2022 07:18 AM
I have just upgraded the entire repo to use the 5.0 version of the Python Driver and at the same time replaced the flask_jwt extension with another library and also fixed some outstanding CORS issues. You should be good now but feel free to ping me if you continue to have problems.
All the sessions of the conference are now available online