Step-by-Step Guide to Installing Python
Step 1: Download Python
Go to the official Python website: https://www.python.org/downloads/
Click on the "Download Python" button. The website will automatically suggest the latest version for your operating system (Windows, macOS, or Linux).
Save the downloaded file to your computer.
Step 2: Install Python on Windows
Double-click the downloaded .exe file to start the installation.
Important: Check the box "Add Python to PATH" at the bottom before proceeding. This allows you to run Python from the command prompt.
Click "Install Now" to begin the installation.
Wait for the installation to complete, then click "Close" when done.
Step 3: Verify Python Installation on Windows
Open the Command Prompt (cmd) by pressing Win + R, typing cmd, and pressing Enter.
Type the following command and press Enter:
python --version
If Python is installed correctly, it will display the installed version (e.g., Python 3.11.2).
Step 4: Install Python on macOS
Download the .pkg file from the official Python website.
Open the downloaded file and follow the on-screen instructions to install Python.
After installation, open Terminal and type:
python3 --version
If installed correctly, you will see the Python version displayed.
Step 5: Install Python on Linux
Open Terminal and type:
sudo apt updatesudo apt install python3
(For Fedora, use dnf install python3, and for Arch, use pacman -S python.)
After installation, verify by running:
python3 --version
Step 6: Install pip (Python Package Manager)
Pip is included with most Python installations. To check if it's installed, run:
pip --version
If not installed, install it using:
python -m ensurepip --default-pip
Step 7: Running Your First Python Program
Open a text editor (Notepad, VS Code, or PyCharm).
Write the following code and save it as hello.py:
print("Hello, World!")
Open a terminal or command prompt and run:
python hello.pyYou should see:
Hello, World!
✅ Python is now successfully installed! 🎉
Would you like help setting up a development environment (e.g., VS Code, PyCharm)? 😊
0 Comments