flask question: I have my run.py
file in the following dir
/Users/`<username>`/Python_stuff/flask
but when I run it it says
(api_automation)MacBook-Pro:flask `<username>`$ ./run.py
-bash: ./run.py: flask/bin/python: bad interpreter: No such file or directory
I'm confused as to why this is happening when its worked in the past on other virtualenv's
here is what the run.py looks like:
#!flask/bin/python
from app import app
app.run(debug = True)
Your file starts with a shebang telling the shell what program to load to run the script. The shebang line is the first line starting with #!
.
In this case, the shebang tells the shell to run flask/bin/python
, and that file does not exist in your current location.
The tutorial you got this from expects you to create a virtualenv directory called flask
, and the script is set up to run the Python binary installed in that directory.
If you are using a different Python location, edit the shebang line to point to the correct location, or use python run.py
to explicitly name the executable on the command line. In that case the shebang line is ignored.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With