Before writing Python programs, we need a place where Python code can be written and executed.
The first step is to install Python on your computer.
Installing Python is usually a simple process. Once Python is installed, you can use tools such as the Python interpreter, IDLE, or VS Code to write and run programs.
In this article, we will learn what Python installation means, how to install Python on Windows, how to check whether Python was installed correctly, and how to run a simple Python program.
What Is Python Installation?
Python installation means setting up the Python programming language and the necessary components on your computer so that you can write and execute Python programs.
When Python is installed, your computer gets the tools required to understand and run Python code.
For example, after installation, you can write:
print("Hello, Python!")
and execute it on your computer.
Why Do We Need to Install Python?
A computer does not automatically understand Python programs just because you have written Python code.
Python needs to be installed so that the computer has access to the Python interpreter and related tools.
For example, consider:
a = 10
b = 20
print(a + b)
To execute this program, your computer needs a Python environment capable of interpreting and running the code.
Therefore, the basic process is:
Write Python Code
↓
Python Installation
↓
Python Interpreter
↓
Program Execution
↓
Output
What Do You Need Before Installing Python?
For a basic Python installation, you need:
A computer
A supported operating system
Internet access to download Python
Sufficient storage space
Permission to install software on the computer
For this beginner guide, we will focus on Windows.
Step 1: Download Python
Python should be downloaded from the official Python website.
Go to:
Look for the download section and choose the appropriate current Python 3 release for Windows.
Python 3 is the modern Python version used for current learning and development.
Step 2: Start the Python Installer
After downloading the installer, open it.
You should see the Python installation window.
One important option is:
Add Python to PATH
It is useful to enable this option during installation.
The PATH setting allows you to run Python from the Windows Command Prompt or other terminals without manually specifying the complete Python installation location.
Step 3: Install Python
After selecting the required options, start the installation.
The installer will copy the required Python files and configure Python on your computer.
Wait for the installation to finish.
Once installation is completed, you should see a confirmation screen.
Step 4: Check Whether Python Was Installed
After installation, open Command Prompt.
You can search for:
Command Prompt
in the Windows Start menu.
Then type:
python --version
and press Enter.
You may see output similar to:
Python 3.x.x
The exact version number depends on the Python release installed on your computer.
What Does python --version Do?
The command:
python --version
asks Python to display its installed version.
For example:
Python 3.14.x
The exact version may be different depending on when you install Python.
This is a useful command whenever you want to check which Python version your computer is using.
Another Way to Check Python
You can also try:
py --version
On Windows, the Python launcher may respond with the installed Python version.
For example:
Python 3.x.x
So you may use:
python --version
or:
py --version
depending on your installation.
What If python Is Not Recognized?
Sometimes you may type:
python --version
and Windows does not recognize the command.
Possible reasons include:
Python was not installed correctly.
Python was not added to PATH.
Another Python configuration is being used.
The terminal needs to be restarted after installation.
If Python was just installed, close Command Prompt and open it again before testing.
You can also try:
py --version
if the Python launcher is available.
Running Your First Python Program
Once Python is installed, let's run a simple program.
Create the following Python code:
print("Hello, Python!")
When executed, the output will be:
Hello, Python!
Congratulations — you have run your first Python program.
What Happens When You Run Python Code?
When you execute:
print("Hello, Python!")
the Python environment processes the code and produces the output:
Hello, Python!
The basic flow is:
Python Code
↓
Python Interpreter
↓
Execution
↓
Output
We will study the Python interpreter in more detail in the next article.
Python Installation vs Python Editor
Beginners sometimes confuse Python with the program used to write Python code.
They are related but not exactly the same thing.
Python
Python provides the programming language and interpreter needed to execute Python programs.
IDLE
IDLE is a development environment that comes with Python installations and can be used to write and run Python programs.
VS Code
VS Code is a code editor that can be configured for Python development using Python-related extensions.
So:
Python
+
Development Tool
↓
Python Programming Environment
Installing Python Does Not Mean Installing VS Code
You do not need VS Code to install Python.
You can install Python separately and use tools such as:
IDLE
Command Prompt
VS Code
Other Python-compatible editors or IDEs
The syllabus introduces these tools separately because each has a different role in the Python development environment.
Python Installation and the PATH Variable
One important concept beginners may encounter during installation is PATH.
PATH is an operating-system environment variable that contains locations where executable programs can be found.
If Python is correctly available through PATH, you can open a terminal and type:
python
instead of manually navigating to the Python installation folder.
For example:
C:\Some\Python\Installation\Folder\python.exe
would not normally need to be typed every time.
Instead, you can simply use:
python
Starting the Python Interpreter
After Python has been installed, open Command Prompt and type:
python
If the Python interpreter starts successfully, you may see a prompt similar to:
>>>
This is called the Python interactive prompt.
You can then enter Python statements directly.
For example:
>>> print("Hello")
Output:
Hello
You can also perform calculations:
>>> 10 + 20
30
This is called interactive mode, which will be covered in more detail later in the series.
Installing Python for Programming Practice
If you are learning Python as a beginner, you do not need to install a large number of additional packages immediately.
Start with the basic Python installation.
Once you understand Python fundamentals, you can later install additional libraries and packages as required.
For example, your future Python with AI journey may involve libraries for:
Data science
Machine learning
Visualization
AI
Web development
Automation
These will be introduced later according to the course sequence.
Python Installation for the Python with AI Journey
In this Python with AI series, Python is the foundation for everything that comes later.
The learning path begins with:
Python Installation
↓
Python Environment
↓
Python Fundamentals
↓
Core Python
↓
Advanced Python
↓
Data Science
↓
Machine Learning
↓
Artificial Intelligence
↓
Generative AI
↓
AI Applications
Therefore, setting up the Python environment correctly is an important first practical step.
Common Problems During Python Installation
1. Python command not found
Try:
py --version
Also check whether Python was added to PATH.
2. Wrong Python version
Check the installed version using:
python --version
or:
py --version
3. Python opens the Microsoft Store
On some Windows configurations, typing python may trigger Windows' app execution aliases instead of the installed Python executable.
If this happens, check your Python installation and Windows app execution settings.
4. Terminal still shows the old configuration
Close Command Prompt and open a new terminal window after installing Python.
Environment changes may not be reflected in an already-open terminal.
How to Confirm That Python Is Ready
A simple checklist:
✓ Python is installed
✓ Python version can be checked
✓ Python interpreter can start
✓ A Python program can be executed
✓ Output appears correctly
Try:
python --version
Then:
python
And finally:
print("Python is working!")
If the program produces:
Python is working!
your basic Python environment is ready.
Python Installation: Quick Summary
| Step | What to Do |
|---|---|
| 1 | Visit the official Python website |
| 2 | Download Python 3 for Windows |
| 3 | Start the installer |
| 4 | Enable the PATH option when appropriate |
| 5 | Complete the installation |
| 6 | Open Command Prompt |
| 7 | Run python --version |
| 8 | Start Python using python |
| 9 | Run a simple Python program |
Frequently Asked Questions
Is Python free to install?
Yes. Python is available as free and open-source software.
Where should I download Python from?
Use the official Python website:
How do I check whether Python is installed?
Open Command Prompt and run:
python --version
You can also try:
py --version
Do I need VS Code to use Python?
No. Python can be used without VS Code. Tools such as IDLE and the command line can also be used.
What is PATH?
PATH is an operating-system environment variable that helps the system locate executable programs such as Python.
Which Python version should beginners learn?
For current Python learning, use a current supported Python 3 release rather than Python 2.
Key Takeaways
Python must be installed before you can normally execute Python programs locally.
Python can be downloaded from the official Python website.
During Windows installation, adding Python to PATH can make command-line usage easier.
python --versioncan be used to check the installed version.py --versioncan also be useful on Windows.Python can be used through the command line after installation.
IDLE and VS Code are development tools that can be used with Python.
Installing Python is the first practical step in setting up a Python programming environment.
Comments
Post a Comment