Install Python and create virtual environment
Here’s how you can create a Python virtual environment step by step:

Step 1: Download Python
- Go to the official website: Python Downloads
- Download the latest Python 3.x (64-bit installer) (most common for Windows).
Step 2: Install Python (Important Settings)
When the installer opens:
Check these boxes before clicking "Install":
- Add Python to PATH (so you can use
pythonfrom Command Prompt). - Choose Customize Installation if you want, otherwise click Install Now.
This ensures Windows knows where to find Python.
Step 3: Verify Python Installed
Press Win + R, type
cmd
(for Command Prompt) or
powershell
, and hit Enter
Type:
python --version
or:
py --version
Expected:
Python 3.12.x
Step 4: Verify pip Installed
Press Win + R, type
cmd
(for Command Prompt) or
powershell
, and hit Enter
Type:
pip --version
Expected:
pip 24.x from C:\Users\YourName\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip (python 3.12)
If pip isn’t found, install it with:
python -m ensurepip --upgrade
Step 5: Navigate to Your Project Folder
In the command line, use
cd
to move into the folder where you want the environment:
cd path\to\your\project
Example:
cd C:\Users\YourName\Projects\MyApp
Step 6: Create the Virtual Environment
In the command line type:
python -m venv myenv
-
python→ Calls Python installed on your system. -
-m venv→ Uses the built-invenvmodule. -
myenv→ Name of the virtual environment folder (you can choose any name).
This will create a folder called
myenv
in your project directory.
Step 7: Activate the Virtual Environment
In the command line type:
myenv\Scripts\activate
If successful, you’ll see the environment name at the start of your command line, for example:
(myenv) C:\Users\YourName\Projects\MyApp>
Step 8: Install Jupyter Notebook and packages
In the virtual environment:
Type to intall and run Jupyter Notebook:
pip install jupyter notebook
jupyter notebook
Type to install packages for your application:
pip install package_name
Step 9: Deactivate When Finished
To exit the virtual environment, just type in the command line: