Closed nawara72 closed 2 years ago
it looks like there isn't a reference within the command line session. I think Windows requires you to run the set
command rather than export. Could you try setting the environment variables within the same command?
FLASK_APP=api FLASK_ENV=development flask run
Thanks Adam for your reply. I run set FLASK_APP=api set FLASK_ENV=development flask run
Also tried set FLASK_APP=api ; set FLASK_ENV=development ; flask run
same error
Do i need to run it in a special folder. Other web searches mention api.py, I can't find that file. Not sure what I am doing wrong. I am mainly following instructions on https://graphacademy.neo4j.com/courses/app-python/0-setup/1-setup/
Thanks Nawar
Can you try all in one line, without set
or semi-colons?
FLASK_APP=api FLASK_ENV=development flask run
Just tried (sandbox) PS C:\Users\cv\Downloads\app-python-main> FLASK_APP=api FLASK_ENV=development flask run
got
FLASK_APP=api : The term 'FLASK_APP=api' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1
+ CategoryInfo : ObjectNotFound: (FLASK_APP=api:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Just checking if the sandbox folder created in the folder that i downloaded from your github Do i need to cd into the sandbox folder? Thanks
Adam, i just figured it out. it works when i run $env:FLASK_APP = "api" $env:FLASK_ENV = "development" Great now i can continous with that course. Thanks again for all your help
Nice, I'm glad you got it working. Was this issue down to the instructions not working in PowerShell?
you only need add FLASK_APP = "api" and FLASK_ENV = "development" in .evn file ,then “ flask run”
Great tip, does that work for all OS?
Nice, I'm glad you got it working. Was this issue down to the instructions not working in PowerShell?
Not sure Adam, the powershell instructions didn't work on windows but using $env did. Thanks again for all your help
My way in Windows is ok ,I do not test in other system。
I've tried all of the above and it's not working. Any ideas?
Can you provide some more information, please? What version of python are you using? Which operating system? What have you tried so far?
Hi I am a newbie to this world so would really appreciate any help. I get an error when running flask run Is there supposed to be an api.py file? The error i get is (sandbox) PS C:\Users\cv\Downloads\app-python-main> flask run
Error: Could not locate a Flask application. You did not provide the "FLASK_APP" environment variable, and a "wsgi.py" or "app.py" module was not found in the current directory.
Thanks