Python can be installed on different operating systems such as Windows, Linux, and macOS. Follow the steps below to install Python.
1. Download Python
- Visit the official Python website: python.org
- Click Downloads.
- Download the latest stable version for your operating system.
2. Install Python (Windows)
- Open the downloaded installer.
- Check the box “Add Python to PATH”.
- Click Install Now.
- Wait for the installation to complete.
- Click Close.
3. Verify the Installation
Open Command Prompt and type:
python --version
or
python3 --version
If Python is installed correctly, the version number will be displayed, for example:
Python 3.13.7
Installing an IDE
An IDE (Integrated Development Environment) is software used to write, edit, run, and debug Python programs.
Popular Python IDEs
- IDLE (comes with Python)
- Visual Studio Code (VS Code)
- PyCharm
- Jupyter Notebook
- Spyder
- Thonny
1. IDLE Setup
IDLE is installed automatically with Python.
Steps
- Click Start Menu.
- Search for IDLE (Python).
- Open it.
- Click File โ New File.
- Write your Python program.
- Save the file with the .py extension.
- Press F5 or choose Run โ Run Module to execute the program.
Example:
print("Hello, World!")
Output:
Hello, World!
2. Visual Studio Code (VS Code) Setup
Installation Steps
- Download and install Visual Studio Code.
- Open VS Code.
- Install the Python extension from the Extensions marketplace.
- Create a new file named
hello.py. - Write the Python code.
- Click Run or use the integrated terminal.
Example:
print("Welcome to Python")
3. PyCharm Setup
Installation Steps
- Download PyCharm Community Edition.
- Install and launch PyCharm.
- Create a New Project.
- Select the installed Python interpreter.
- Create a new Python file.
- Write the code and click Run.
Writing and Running Your First Program
Create a file named hello.py.
print("Hello, World!")
Save the file and run it.
Output
Hello, World!
Advantages of Using an IDE
- Syntax highlighting
- Auto-completion
- Error detection
- Debugging tools
- Code formatting
- Project management
- Integrated terminal
Common Installation Problems
| Problem | Solution |
|---|---|
python command not found | Add Python to the system PATH or reinstall with Add Python to PATH selected. |
| IDE cannot find Python | Configure the correct Python interpreter in the IDE settings. |
| Program does not run | Save the file with a .py extension and ensure there are no syntax errors. |
Category: Uncategorized
