# Flask configuration for training

**URL:** https://community.neo4j.com/t/flask-configuration-for-training/59563
**Category:** General
**Tags:** migrated
**Created:** [April 7, 2022, 7:07pm UTC](https://community.neo4j.com/t/flask-configuration-for-training/59563 "2022-04-07T19:07:01Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![robertodipace](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/robertodipace/32/4248_2.png) [@robertodipace](https://community.neo4j.com/u/robertodipace)
#### Post date: [April 7, 2022, 7:07pm UTC](https://community.neo4j.com/t/flask-configuration-for-training/59563/1 "2022-04-07T19:07:01Z")

</div>

Hello,  
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.  
Best regards

(sandbox) C:\VirtualEnv\Neo4J\_Flask\>flask run

- Serving Flask app 'api' (lazy loading)
- Environment: development
- Debug mode: on  
Usage: flask run [OPTIONS]  
Try 'flask run --help' for help.

Error: While importing 'api', an ImportError was raised.

---

<div class="post-metadata">

### Author: ![Nana30](https://avatars.discourse-cdn.com/v4/letter/n/eb8c5e/32.png) [@Nana30](https://community.neo4j.com/u/Nana30)
#### Post date: [July 6, 2022, 3:36pm UTC](https://community.neo4j.com/t/flask-configuration-for-training/59563/2 "2022-07-06T15:36:48Z")

</div>

Hi there,

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 😉

---

<div class="post-metadata">

### Author: ![Alex29](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Alex29](https://community.neo4j.com/u/Alex29)
#### Post date: [August 5, 2022, 1:30am UTC](https://community.neo4j.com/t/flask-configuration-for-training/59563/3 "2022-08-05T01:30:04Z")

</div>

thank you I had the same problem and you solution worked for me too!

---

<div class="post-metadata">

### Author: ![emack](https://avatars.discourse-cdn.com/v4/letter/e/90ced4/32.png) [@emack](https://community.neo4j.com/u/emack)
#### Post date: [August 9, 2022, 8:39am UTC](https://community.neo4j.com/t/flask-configuration-for-training/59563/4 "2022-08-09T08:39:11Z")

</div>

Hello all, is there a way to do this in Windows with python 3.10? I am getting the same error as above...

---

<div class="post-metadata">

### Author: ![emack](https://avatars.discourse-cdn.com/v4/letter/e/90ced4/32.png) [@emack](https://community.neo4j.com/u/emack)
#### Post date: [August 9, 2022, 9:26am UTC](https://community.neo4j.com/t/flask-configuration-for-training/59563/5 "2022-08-09T09:26:01Z")

</div>

BTW as an FYI for Window cmd some of the code in the project setup is different:

1. sandbox\Scripts\activate instead of source sandbox/bin/activate
2. copy .env.example .env instead of cp .env.example .env

---

<div class="post-metadata">

### Author: ![Nana30](https://avatars.discourse-cdn.com/v4/letter/n/eb8c5e/32.png) [@Nana30](https://community.neo4j.com/u/Nana30)
#### Post date: [August 15, 2022, 4:08pm UTC](https://community.neo4j.com/t/flask-configuration-for-training/59563/6 "2022-08-15T16:08:41Z")

</div>

Hi,

I didn't find a solution. In order to make it work, the project needs to be rewritten with python 3.10 I think.

---

<div class="post-metadata">

### Author: ![Monica](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@Monica](https://community.neo4j.com/u/Monica)
#### Post date: [August 15, 2022, 5:31am UTC](https://community.neo4j.com/t/flask-configuration-for-training/59563/7 "2022-08-15T05:31:37Z")

</div>

I confirm this, thank you!!

---

<div class="post-metadata">

### Author: ![youjuin](https://avatars.discourse-cdn.com/v4/letter/y/f1d935/32.png) [@youjuin](https://community.neo4j.com/u/youjuin)
#### Post date: [August 31, 2022, 7:51am UTC](https://community.neo4j.com/t/flask-configuration-for-training/59563/8 "2022-08-31T07:51:16Z")

</div>

'Flask run' command only can be run under python-3.9.

(sandbox) PS C:\Users\ychen70\Downloads\app-python-main\> python --version  
Python 3.9.13  
(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/](http://127.0.0.1:3000/) (Press CTRL+C to quit)

---

<div class="post-metadata">

### Author: ![gerard300](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@gerard300](https://community.neo4j.com/u/gerard300)
#### Post date: [September 21, 2022, 3:37pm UTC](https://community.neo4j.com/t/flask-configuration-for-training/59563/9 "2022-09-21T15:37:30Z")

</div>

Hi,

As an alternative you can use conda instead of venv (so frustating)

conda create -n pthon-neo4j python=3.9

(Mac Path) --\> /Users/\<your\_user\>/opt/anaconda3/envs/pthon-neo4j/bin/pip install -r requirements.tx  
And then  
flask run

That worked for me!

---

<div class="post-metadata">

### Author: ![RSam3](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@RSam3](https://community.neo4j.com/u/RSam3)
#### Post date: [September 26, 2022, 6:11pm UTC](https://community.neo4j.com/t/flask-configuration-for-training/59563/10 "2022-09-26T18:11:36Z")

</div>

Since it hasn't been stated yet, the course has been updated for python version 3.10. This issue should be resolved.
