When I try to install anything with Pip, it gives me the "Fatal error in launcher:" error. That wouldn't be too bad, since I know how to update Pip differently. However, the same error occurs when I try to run the "flask run" command.
I'm using Windows 10, Python 3.8.2 and I have previously set the FLASK_APP variable to flaskblog.py. This is its content:
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
Since you haven't posted the error clearly, if Fatal error in launcher: Unable to create process using '”'
is your error,
then you might want to update pip
using python -m pip install --upgrade pip
and try installing your package again using python -m pip install <pkg-name>
. You should get it working.
if the error persists after the above mentioned steps, the try importing pip
in your python console(pull up your terminal and type python
then type import pip
) and try pip.main(['install','<pkg-name>'])
in the console.
Hope this helps.
referred from here
Alternatively, you can run your flask app by adding app.run()
in your script.
Like:
if __name__ == __main__:
app.run()
and then in the terminal, run python -m flaskblog.py
.
Note: if you want to run your app in debug mode, consder giving debug = True
to app.run()
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.