Before we get down to business, let’s lay down a few requirements you’ll need to follow through this part of the article:
- You are running on a Windows machine, and the version is Windows 8 and up.
- You have Python installed on your machine.
- You have Visual Studio Code (or your preferred text editor) installed on your machine.
Now that we have that out of the way, let’s get down to it. We are first going to use the command prompt to (1) get to the Desktop, (2) make a folder called ‘qa-demo’, (3) navigate into the folder, and (4) create a Python virtual environment inside it. We can start by launching the Command Prompt and entering the following commands, line by line:
cd Desktop
mkdir qa-demo
cd qa-demo
python -m venv venv
If you’ve completed the steps correctly, you should be able to see the ‘qa-demo’ folder on your desktop, with a folder ‘venv’ inside it. Now, go back to your command prompt and enter the following to launch the virtual environment:
venv\Scripts\Activate
Once it’s all done, you should see (venv) in front of your command line — and if you do, congratulations, you’re in!