Okay, so the title may be a bit dramatic, but I definitely yelled many curse words at my poor laptop yesterday while attempting to complete the Flask tutorial. The objective at hand was initially to install Flask itself. First off, I was at a slight disadvantage due to the laptop in question being a Windows machine. I don’t have Linux/Unix. I didn’t start with the correct version of Python. I’m not experienced with installing things on the Windows command line.
The worst part was that the instructions on how to set up the virtual environment for Windows on the Flask tutorial was not very helpful. It was especially insulting that I needed to run something called “easy_install” and it had clearly become difficult for me. Thankfully I finally realized that there’s got to be more information about this outside the tutorial. And thus I found my way to a blog post which was titled “Installing easy_install…could be easier.” Magically, my problems were solved. Or so I thought.
Frustratingly, Flask is not supported by versions of Python under 2.5 and over 3.0. Of course, I already possessed Python 2.4 and 3.2. None of which were going to work. When I got to the Python download page, I thought to myself “Wouldn’t it be fun to unpack this tarball on the command line?” NO, IT’S A TRAP DON’T GIVE IN! But alas, hindsight is only from the future. Foolishly, I attempted to make it work. After spending considerable time fretting over the many Python files, I decided to go ahead and download the simple Windows installer widget. I was the proud owner of Python 2.7 within minutes. Sigh.
I began the actual tutorial after finally completing the setup and everything was fine until Step 3: Creating The Database. Basically, I know what databases are, but have I ever used one before? Not really. I barely know what SQL is yet here I am trying to implement something called SQLite3 which sounds a lot like a diet beverage. So, I type up the code, import it onto the command line, and call the initialize database function. …the database file that does not exist cannot be opened. Alright, fine. If my homework doesn’t want to be done, who am I to judge it?
We went over the tutorial in class. My partner and I ran into this exact error once again, yet this time it was solved by a simple path name fix. I had thought my path name had issues, but tried to fix it with no luck on Sunday. Maybe tomorrow I’ll give it another go.
P.S. I’m sure Flask is actually super awesome. This is just another example of why I need to give myself more breaks during coding sessions!