Installing Flask in 3 hours

I’m still not ready to follow the lyricize tutorial I guess
since the very next step is „through them into a requirements file“
and I’m wondering where the heck do I put it, and where to get the requirements.
So I’m into the tutorials before about setting up flask and
„flask tracking“.
„Flask Track Usage is a very light weight Flask extension to track usage traffic for Flask apps.
This post will give you a brief introduction to the usage and merits.“
inspiring post about python and flask being super powerful.

oh flask is a microframework. What is a microframework?

what is a web application framework?
ok so it has libraries, templating, session management?
It’s a software framework.

What is a software framework?

So I actually have to start on the basic tutorial for using flask
which is :
creating a web app called flaskr

step 0: creating the folers. I don’t know about them but for me
I need to say mkdir to make new folders

step 1: Now I need to know how to make a database with sqlite
because new text file -> change name to schema.sql didn’t work…

wow, I am having issues with this
I can’t even „import“ sqlite let alone create a .sql table file in
a specified location. The net is giving a lot of info that is not really helping
I think once I do get it installed I’ll have to use some kind of sql command
line to create the table? Iunno

I took a break, I just felt physically shity, maybe it was the stonemilled
bread or the swisscheese I had for breakfast. Also working till 10 seems to
affect the quality of my sleep which I felt immediatly on waking up. Either
way I have energy but not like yesterday. SO I decided to lay down and do some
relaxation breathing. I was thinking during this time to because well I just
had a lot of thoughts.

So my thoughts were:
let go of flask and move on to at least using heroku
try to use another database and follow along, like sqalchamemy
it seems just like trying to learn python from a standard tutorial is
slow and ineffective, so is trying to do things the way any tutorial
says I should. I just don’t work that way. I need to do things my own way and be creative.

Another idea I got was to try to use pip install sqlite
another idea is that I can atleast now try the markov program again using py
and see if it works.

omg I tried pip and at least it said collecting before saying it couldn’t
find specified version
Then I googled pip sqlite and got something saying try pip search sqlite and
it generates a huge list

ok, and now a SO forume post has a guy saying he get’s errors
with pip install and the answer is I don’t need to install sqlite3
cause it comes with python2.5 and up…

below it is a guy saying he tried pip install pysqlite (he has py2.7
that worked, it’s downloading. Also I got an AVG threat detected on pip
but I let it go.

so it says completed, but then there is an error missing parenthesis for print
which I guess means pysqlite is trying to install a version below python34
and it’s causeing an error there.

I’ll trying pip install pysqlite3
collecting, retring after timeout…couldnotfind verion
I can also just install and earlier version of python if I’m going to keep
having issues.

ok now I’m following the sqlite tutorial which says download the bindaries etc
in C:

followed all steps (except I just add C:\sqlite not C:\>sqlite)
Then I entered sqlite got error which I expected.
closed and reopened powershell CAUSE I HAVE TO DO THAT after adding a path

and now I got it!

now to create sql file…
oh i guess that didn’t require the sql commandline afterall?
Just need notepad++?
and I’ll use it for creating .py files too I guess

how to exit out of sqlite3
use .help to find out … it’s .quit

ok trying to import flask again says no module found so I’m looking
back at installation of flask.

oh right it’s already installed, I’m just not using it,
I follow this
to activate a virtual environment.

then go: venv\scripts\activate
…“cannot be loaded because the execution of scripts is disabled on this system“.

SO person says set execution policy to unrestricted.
Set-ExecutionPolicy Unrestricted -Force
got another error, more reading says run powershell as admin so I can change it
ok wow it works, and pip install flask now works

markov Chatbot 2b: (just continuing from last post)

etc till you get to c:\
then cd windows\system32\windowspowershell
ls to list contents which will show version and then cd v1.0 (or your version)
this is to get us to the powershell directory

then copy paste this into the powershell at that location
[Environment]::SetEnvironmentVariable(&q­uot;Path“, „$env:Path;C:\Python27\;C:\Python27­\Scripts\“,
after reading further I learn this environmental variable thing is to do with setting a windows path
to python

I get an error missing ‚)‘ but I’m not, it could be that it’s trying to install a version of
python when I already have one or something

next is
in c:\

I can’t I need admin privlages so I put it in student
Also I can’t run it because apparently python is not recognized

holy shit, so in python 3.4 it’s py not python
so it’s now downloading it

next thing to try is py -U setuptools

not working, however, on youtube the guy said to check the scripts folder
of python to see it easy installer is there and it is and it says last
modified a few months ago so I know I didn’t get it just now.

someone on stackexchange suggested I add a line „print(saveto)“
at the download_setuptools area under saveto = os.path etc
I did it and miraculusly then trying py actually worked.

ok so I have setup tools installed.

another hint Also, for python3, use easy_install3 and python3-setuptools

ok, unlike python, pip is only installed and pathed to python34/scripts/pip
so I need to add a path to where I want to use it from.

wow, ok so I needed to add [Environment]::SetEnvironmentVariable(„Path“, „$env:Path;C:
\Python27\Scripts“, „User“)

which that guy in the other video suggested but which didn’t work for some reason.

wow so I see more youtube videos where the uploader answering questions
keep saying, you have ot add a path.
I did that and it didn’t work but then I found another comment about
doing it from the control panel and when I did that and saw the path
I realized it says python 27, but I’m using python 34
so I changed that. Now I will try again.

didn’t work
and then I checked that I pressed ok and that it said scripts, but it was right…
still no
I closed poowershell and opened it again, then it worked! Holy shit.
well it installed a bunch of pip scripts and processed dependancies for pip.

Markov Chatbot 2a: So much to know

So I get to what seemed like half way through the
tutorial and I’m hit with“if you haven’t learned this and this and this
already, please refer to this and this and this.“

A lot of the reference manuals seem to not be made for people just
starting out. I did learn somethings like
easy installer
ex installer
freeze > requirements

and so on and I have to put all that together now

Also apparently python 3 (at least at the time this one doc was created
was not the best for flask? or something and so I hope it is now.

So here is what I’ve deduced about how I need to proceed with the tutorial

I need to instal flask and that depends on two external libraries
to get those onto my computer the best way apparently is to use a virtualenv which allows
me to use different verions of python at the same time

in order to use virtualenv I need to install it
to install it I need easy_install (and „setup tools“?) is a file used to „bootstrap“ setuptools on any system
I’m suppposed to „download“ it although when I click the link on
this site it just opens as text on a webpage
I can try to save it as a python file.

then there is also so iunno

also the tutorial does a lot of commandline stuff with the $ and I guess
that isn’t for windows. Either way I don’t know how to run python scripts
from the commandline or even which commandline to use or what location it
should be in.

I’m going to follow a vid that says put the ez_setup file as a .py in C://
and then navigate powershell there and call it. that way.

this is a more basic tutorial on flask that is still way too advanced

this is the installation of flask which is still way too advanced

and another one

so open powershell
cd ..
cd ..