Instructions for Installing Flask Webframework
Run the following commands in a bash terminal. Type exactly
what is given in green colour.
- Check that you have installed Python >=3.9:
python3 --version
- Change directories to your home directory:
cd
- You can use this directory for all virtual environments that
you may create in the future.
- Make a directory for virtual environments and cd into it:
mkdir .venv
cd .venv
- Create an environment called flaskapps in the directory:
python3 -m venv flaskapps
- Activate/use the environment:
source flaskapps/bin/activate
You should see (flaskapps) before your normal terminal
prompt. If you don't, please call your TA or System Administrator
You are now done with creating the virtual environment. Do the
following to install flask and pandas.
- Make a directory for your Flask applications and change
into it:
mkdir ~/public_html/flaskapps
cd !$ (If, for any reason, you did not change into the
newly created directory, type
cd ~/public_html/flaskapps
)
- Type pip3 install Flask
Note the capital F!
If there is any problem here, contact the TA or the System
Administrator
- Type pip3 install pandas to install Pandas module for
Python.
- Now you can follow the tutorial examples to play with Python
apps and Flask.
Finally remember to get out of the flaskapps
environment before you logout.
Type deactivate
Verify by checking your prompt in the terminal. It should not have
(flaskapps) before the normal prompt.