Unit A Lesson A2
Screen 1 of 11
1) Installing Python
2) Creating a virtual environment
3) Installing Flask
4) Configuring Flask
5) Building your first local Flask app
6) Running your first Flask app
7) Understanding web servers
8) Deploying to PythonAnywhere
Unit A Lesson A2
Screen 2 of 11
Unit A Lesson A2
Screen 3 of 11
A virtual environment is an isolated working copy of Python which allows you to work on a specific project without affecting other projects
Unit A Lesson A2
Screen 4 of 11
1) It enables multiple side-by-side installations of Python, one for each project
2) It doesn't install separate copies of Python
3) It keeps different project environments separated
Unit A Lesson A2
Screen 5 of 11
Step 1. Installation
You'll install virtualenv in your project folder
Step 2. Creation
You'll create your virtual environment (VE)
Step 3. Activation
You'll activate your VE and verify its activation
RIGHT! Let's go and do it!
Unit A Lesson A2
Screen 6 of 11
Please install virtualenv by :
Opening a command prompt
type cmd into windows search to open dialogue box
Type pip install virtualenv into the command line
Unit A Lesson A2
Screen 7 of 11
next we will create the virtual environment
Please create your virtual environment by:
Opening your previously created project folder
use command cd to change the directory
e.g. cd c:\IEUser\myproject (if this is your project directory)
Creation of the virtual environment in your project folder
Type virtualenv venv into the cmd prompt
This creates a new folder called venv with subfolders
Change into the new venv folder
Type cd venv
Unit A Lesson A2
Screen 8 of 11
next we will activate the virtual environment
Please activate your virtual environment by:
From the venv folder open the scripts folder
type cd scripts taking you c:\IEUser\myproject\venv\scripts
e.g. cd c:\IEUser\myproject (if this is your project directory)
Activate the new virtual environment
Type activate.bat
Verify that the virtual environment is active
The command line should begin with (venv) c:\ etc
Unit A Lesson A2
Screen 9 of 11
Having completed Unit A Lesson A2 you should now successfully be able to:
Unit A Lesson A2
Screen 10 of 11
Please click on the link below and perform the short quiz before you proceed to Unit B1:
Unit A Lesson A2
Screen 11 of 11