Python Installation on Windows
Installing Python on a Windows machine and running scripts is a straightforward process.

Here is a step-by-step guide to help you through the process: Python Installation on Windows
Step 1: Download Python Installer
- Visit the Python Official Website:
- Go to the Python official website.
- Download the Installer:
- Click on the “Downloads” tab.
- The website should automatically detect your operating system. Click the “Download Python 3.x.x” button to download the latest version. Ensure you download the version appropriate for your system (32-bit or 64-bit).

Python Installation on Windows
Step 2: Install Python
Run the Installer:
- Locate the downloaded installer in your Downloads folder and double-click it to run.
Python Installation on Windows

Setup Options:
- Add Python to PATH: At the bottom of the installation window, check the box that says “Add Python 3.x to PATH.” This is important as it makes it easier to run Python from the command line.
- Choose the Installation Type: Click on “Install Now” for the default installation, which is recommended for most users. Alternatively, you can click “Customize installation” if you want to choose specific features or installation locations.
Wait for the Installation to Complete:
- The installer will copy Python files to your system and set up the necessary environment variables. This may take a few minutes.
Python Installation on Windows


- Verify Installation:
- After installation, open the Command Prompt (cmd) and type:
python --version

This should display the installed version of Python.
Step 3: Install a Text Editor or IDE (Optional)
While you can write Python scripts using any text editor, using an Integrated Development Environment (IDE) can enhance productivity. Some popular options include:
- VS Code: A free, open-source editor with Python support.
- PyCharm: A professional IDE specifically for Python development.
- Sublime Text: A versatile text editor with Python support.
Step 4: Writing and Running Python Scripts
Writing a Python Script
- Open Your Text Editor or IDE:
- Open your preferred text editor or IDE.
- Write a Simple Python Script:
- For example, write the following code to print “Hello, World!”:
print ("Hello World! Sanchit Gurukul")
- Save the Script:
- Save the file with a .py extension, such as hello.py.
Step 4: Running a Python Script

- Open Command Prompt:
- Press Win + R, type cmd, and press Enter.
- Navigate to the Script Location:
- Use the cd command to change the directory to where your script is saved. For example:
- Run the Script:
- Type python followed by the script name:
python hello.py

- This will execute your script and print “Hello, World!” to the command prompt.
Python Installation on Windows
Step 5: Installing Packages with pip
Python comes with pip, a package manager that allows you to install and manage additional Python packages.
- Verify pip Installation:
- Check if pip is installed by running:
pip --version

Python Installation on Windows
- Install a Package:
- To install a package, use the pip install command. For example, to install the requests library:
pip install requests

- Using Installed Packages in Scripts:
- You can now use installed packages in your Python scripts. For example:
import requests
response = requests.get("https://www.sanchitgurukul.in")
print(response.text)
- Run the Script:
- Save the above code in a file named example.py and run it using the command prompt:
python sanchitgurukul.py

Troubleshooting Common Issues
- Python Command Not Found:
- Ensure Python is added to the PATH environment variable. You can manually add it by editing the system environment variables.
- pip Command Not Found:
- Make sure pip is included in the installation. Re-run the installer and ensure the pip option is checked.
Summary
Installing Python on a Windows machine involves downloading the installer from the official Python website, running the installer with the option to add Python to the system PATH, and optionally setting up a text editor or IDE. Writing and running scripts is simple, requiring only a text editor to create the .py file and the command prompt to execute it. Additionally, Python’s pip package manager makes it easy to install and manage external libraries, enhancing the functionality of your Python environment. By following these steps, you’ll be ready to start coding in Python on your Windows machine.
Useful Links
https://sanchitgurukul.com/tutorials-cat
Effortless Python Installation on Windows: Step-by-Step Guide with IDE and pip
This article provided insights on the topic. For latest updates and detailed guides, stay connected with Sanchit Gurukul.
