⏲️ Est. time to complete: 45 min. ⏲️
You wil learn the following:
- Installing Git
- Installing Python
- Installing Python Libraries
- Setting up Python Virtual Environment
- Installing Visual Studio Code
- Install Git
- Install Visual Studio Code
- Install Python
- Clone To-Do Application Repository
- Setup Python Virtual Environment
Depending on the operating system you are using, chose appropriate installation method below. For more details on Git and various installation refer to Install Git on GitHub
Following the instruction below to install Git on Windows operating system. For detailed inf
-
Verify if you already have the Git installed on your computer by checking below
-
If Git is previously not installed, click here to download Git installer for Windows.
-
By default download file is located in the Download folder on your computer. If download location is changed, navigate to that location to install Git.
-
Double click on the Git installer file highlighted above to begin installation. You will Git setup menu as shown below, and click Next.
-
Follow onscreen instructions and accept defaults folder to install Git, then click Nex to continue and accept all defaults until you reach Install option as shown below and click Install.
-
Once the installation complete, uncheck View release notes in the last screen and click Finish.
Follow the instructions below install VS Code on your computer. Visit Visual Studio Code download page to download latest version of installation package for your computer operating system.
-
Download VS Code installer for Windows by clicking here. This is a user installer to install for current user. Download system installer to install for all users using the computer. This will require elevation permissions to install for everyone.
-
Go to Downloads folder and double click VS Code installer to start installing
-
Accept license agreement and click Next to continue installing VS Code.
-
Follow onscreen instructions and accept all default options and continue to the Ready to Install option. Click Install to finish installing VS Code and wait for the installation to complete.
-
Uncheck Launch Visual Studio Code and click Finish to close the installer.
If you haven't already installed Python locally on your computer, follow instructions below to install Python.
- Open a terminal/console window. You can use the command prompt or powershell (i.e., "cmd.exe").
- Once inside the terminal, type
python
. - This should bring up a window from the Microsoft Store that allows you to install Python:
- Click the
Get
button and wait for it to finish downloading
If that didn't install Python or bring up the Microsoft Store's Python page, you can also just open the Microsoft Store and search for Python
. Pick the 3.12 version in the list that shows up.
We now need to create a local copy of the To-Do Application repository that we created in an earlier step.
-
From the To-Do Application repository on GitHub, click on the "Code" button and copy the link to the repository
-
Open a terminal/console window. For windows users you can use the command prompt or powershell (i.e., "cmd.exe"). For Mac and Linux users you can use the terminal application.
-
Navigate to the directory where you want to store the project
-
Run the following command to clone the repository:
git clone <link_to_this_repo>
-
Navigate to the project directory:
cd <project directory>
-
From the terminal window, navigate to the project directory
cd <project directory>
[!TIP] The repository for this training has a directory named
myApplication
that you can use as your default working directory while building the application or feel free to choose any directory where you would like to put this application. -
Copy the following
requirements.txt
file from Sprint 0 into your project directory. -
Open up Visual Studio Code in the project directory by executing the following command.
code .
-
From Visual Studio Code, either select "View/Command Palette" or press
Ctrl+Shift+P
to open the command palette. -
In the search box, type
Python
and then select the optionPython: Create Environement...
from the list of options. -
An environment type selection box will appear. Select
Venv Create a '.venv' environment in the current workspace
from the list of options. -
Select the Python interpreter version to use for the virtual environment. If you have multiple versions of Python installed, you should select the version that you installed in the previous step.
-
Check the box next to the
requirements.txt
file to install the required packages in the virtual environment and hit ok. -
You will see a notification in the bottom right corner of the screen indicating that the virutal environment is being created. This can take a few minutes to complete.
-
Once the virtual environment is created, you should see a notification in the bottom right corner of the screen indicating that the virtual environment has been created. This will create a new directory called
.venv
in the project directory that will contain the virtual environment. All python packages installed in this environment will be isolated from the global python environment. -
Open up a terminal window in Visual Studio Code and activate the virtual environment by running the following command.
.venv\Scripts\Activate
You should see the name of the virtual environment in the terminal prompt to indicate that the virtual environment is active.