My settings are:
Beginner at Python
Windows 10
Python 3.6
pip installed on Python
Thonny 2.1 - installed with Python pip
basically I haven't used classical Python, but write code through Thonny and manage packages as well - probably the only packages that I've installed on Python are pip and Thonny
All the other packages(not that many) are installed through Thonny package manager - and they work.
The problem:
Installed Flask on Thonny
tried to run this code:
########
# CODE#
########
from flask import Flask
app = Flask(__name__)
@app.route('/')
def homepage():
return """
Hello world!
This is my first web app!
"""
if __name__ == '__main__':
app.run(use_reloader=True)
It throws out error, if launched on Thonny via GUI:
OSError: Windows error 1
It runs, if installed Flask on python via pip and when launching it by console, so it generates HTML page on localhost:5000
What is the difference? Why python can run it and can code be run by Thonny GUI?
Do I have to set something? It's not a big deal at the moment, but I like using Thonny GUI option to run script(while learning and writing code), than firing up console and create clutter on desktop.