I'm trying to setup the Neo4J-Flask course but, after some tries I still receive the same error when launch Flask run command:
"Error: While importing 'api', an ImportError was raised."
below the full cmd log.
New to Flask configuration (Windows).
Thanks for hints.
(sandbox) C:\VirtualEnv\Neo4J_Flask>flask run
Error: While importing 'api', an ImportError was raised.
Hey Adam, I run into same problem as Roberto. Trying to setup Building Neo4J Application with Python ends up with:
(sandbox) app-python % flask run
Same holds for all hints from Help, failing on "flask run", e.g.:
(sandbox) app-python % FLASK_APP=api FLASK_ENV=development flask run
FLASK_APP=api FLASK_ENV=development flask run
I'm using: macOS 12.2.1, zsh 5.8, Python 3.10.4, pip 22.0.4
Any ideas ? Thanks!
so, after nearly throwing in the towel, I found a solution for me: I had the wrong Python-Version (3.10) installed. Uninstalled Version 3.10 and installing Version 3.9 works now for me. Maybe the course designer could mark that with some color, that the Python version is crucial!
Hopefully I can do the course without any further obstacles now 😉
'Flask run' command only can be run under python-3.9.
(sandbox) PS C:\Users\ychen70\Downloads\app-python-main> python --version
(sandbox) PS C:\Users\ychen70\Downloads\app-python-main> Flask run
* Serving Flask app 'api' (lazy loading)
* Environment: development
* Debug mode: on
* Restarting with stat
* Debugger is active!
* Debugger PIN: 412-471-481
* Running on http://127.0.0.1:3000/ (Press CTRL+C to quit)