Install Flask with Easy Steps in Windows
If you were looking for a quick tutorial on how to install Flask in Python for web developement applications,
you're in the right place. I'm using Python 3.4 since already has PIP installed, which we're going to
use to install Flask. (Python 2.7 doesn't include the PIP). Let's begin:
1. You need to head over the Environment Variables of your system.
2. Control Panel > Advanced System Settings > Environment Variables > System Variables
3. Choose Path
You should see a large path. In the end just add this: ;C:\Python34\Scripts
if it isn't already there. Note that the semicolon in the start you need to add it only when there is
something like "C:\Someprogram\ ".
-> If that was the case, the final result would be:
4. Open Console: Press "Windows Key" + R, type cmd,hit "Enter" and type the following commands in order:
pip install virtualenv
flask\Scripts\pip install flask
Open a new python file and paste the following code
5. Creating the __init__ file
from flask import Flask
app = Flask(__name__)
return "This is my first site in python"
if __name__ == "__main__":
Save file as __init__.py inside your myWebsite folder.
6. Type commands in order:
You should see something like: (flask) C:\pythonWebsite\myWebsite>
You can see that something's running and there is an ip. Usually it's something like: 127.0.0.1:5000.
Copy that ip and paste it in the url of your browser. Now you can see your website.
Have fun coding!