Skip to main content

Python With AI Agent


How to Install Python on Windows (2026 Step-by-Step Guide)

Python is one of the easiest and most popular programming languages in the world. Whether you want to build websites, automate tasks, create desktop applications, or work with artificial intelligence (AI), Python is a great language to learn. It is free, open source, and supported by a large community of developers.

If you're new to programming, this guide will show you how to install Python on Windows step by step. 

  What is Python?

Python is a high-level programming language created by Guido van Rossum and first released in 1991. It is known for its simple syntax, making it an excellent choice for beginners and professionals alike.

Python is used by companies such as Google, Microsoft, Netflix, NASA, and many others for a wide range of applications.

Why learn Python?

Python can be used for many different purposes, including:

  • Web development
  • Artificial Intelligence (AI)
  • Machine Learning
  • Data Science
  • Automation
  • Desktop applications
  • Game development
  • Cybersecurity
  • APIs and web services

Its simple syntax allows beginners to start coding quickly.


System Requirements

Before installing Python, make sure your computer meets these basic requirements:

  • Windows 10 or Windows 11
  • At least 4 GB of RAM (8 GB recommended)
  • Around 500 MB of free disk space
  • Internet connection to download the installer

Step 1: Download Python

Open your web browser and visit the official Python website:

https://www.python.org/downloads/

The website automatically suggests the latest stable version for Windows.

Click the Download Python button.

Download the Windows Installer (64-bit) if your computer uses a 64-bit operating system.

Step 2: Verify the Installation

Open Command Prompt.

Run:

python --version

or

python -V

Example output:

Python 3.x.x

If you see the version number, Python has been installed successfully.


Step 3: Finish Installation

When the installation completes, you'll see:

Setup was successful

Click Close to exit the installer.

Python is now installed on your computer.


Step 4: Verify the Installation

Open Command Prompt.

Run:

python --version

or

python -V

Example output:

Python 3.x.x

If you see the version number, Python has been installed successfully.


Step 5: Check pip

Python automatically installs pip, the package manager used to install Python libraries.

Run:

pip --version

Example:

pip 25.x from ...

Step 6: Create Your First Python Program

Create a file called:

hello.py

Open the file and write:

print("Hello, World!")

Save the file.

Open Command Prompt in the same folder and run:

python hello.py

Output:

Hello, World!

Congratulations! You have written and executed your first Python program.


Connecting to Ollama with the Python Library

Ollama provides a simple Python library that allows developers to communicate with locally running language models. Before using the library, install Ollama, download a model such as llama3, qwen3, or phi3, and make sure the Ollama service is running. After installing the Python package, you can send prompts to the model and receive AI-generated responses directly from your Python application.

Install the Python Library

pip install ollama

Import the Library

import ollama

Generate a Response

import ollama

response = ollama.chat(
    model="llama3",
    messages=[
        {
            "role": "user",
            "content": "Explain what artificial intelligence is."
        }
    ]
)

print(response["message"]["content"])

Generate Text

import ollama

response = ollama.generate(
    model="llama3",
    prompt="Write a paragraph about Python programming."
)

print(response["response"])

List Installed Models

import ollama

models = ollama.list()

print(models)

Pull a Model

import ollama

ollama.pull("phi3")

Delete a Model

import ollama

ollama.delete("phi3")

Connect to the Ollama API

By default, the Python library communicates with the local Ollama API running on:

http://localhost:11434

You can also call the REST API directly using the requests library.

import requests

url = "http://localhost:11434/api/generate"

data = {
    "model": "llama3",
    "prompt": "Hello!",
    "stream": False
}

response = requests.post(url, json=data)

print(response.json()["response"])

The Python library automatically connects to the local Ollama server, making it easy to integrate local language models into desktop applications, web applications, automation tools, and AI assistants.

Comments

Popular posts from this blog

Neural Networks Explained for Beginners (2026 Guide) with PyTorch

Neural Networks Explained for Beginners (2026 Guide): Learn Neural Networks with PyTorch Meta Description: Learn neural networks from scratch with this beginner-friendly 2026 guide. Understand neurons, layers, activation functions, backpropagation, training, and build your first neural network with PyTorch. Suggested URL Slug: neural-networks-explained-for-beginners-pytorch Introduction: What Is a Neural Network? Artificial intelligence has moved from being a futuristic concept to becoming part of everyday technology. Search engines, recommendation systems, voice assistants, image recognition, translation tools, chatbots, and generative AI all rely on powerful machine learning techniques. At the heart of many modern AI systems are neural networks . If you are completely new to artificial intelligence, the term neural network may sound complicated. You may have heard about neurons, layers, weights, activation functions, backpropagation, gradients, and training, but not know how these...

Model Context Protocol (MCP) Explained: The Complete Beginner's Guide 2026

  Model Context Protocol (MCP) Explained: The Complete Beginner's Guide (2026) Introduction Artificial intelligence has changed how we interact with computers. Modern AI assistants can answer questions, write code, summarize documents, analyze data, and help users complete complex tasks. However, traditional AI models have a major limitation: they usually do not have direct access to your personal tools, applications, databases, files, or real-time information. For example, imagine asking an AI assistant: "Read my latest project files and find bugs." "Check my company database and create a report." "Update my calendar with this meeting." "Search my private documents and summarize important points." A normal AI model cannot automatically perform these actions because it does not have a standardized way to communicate with external systems. This is where Model Context Protocol (MCP) becomes important. Model Context Protocol is ...

How AI Really Learns: Neural Network Training Explained for Beginners (2026)

  How AI Really Learns: Neural Network Training Explained for Beginners (2026) Introduction Artificial Intelligence (AI) powers many of the tools we use every day—from ChatGPT and Google Search to self-driving cars and medical diagnosis systems. But have you ever wondered how AI actually learns ? The answer lies in neural network training . During training, an AI model learns patterns from large amounts of data, gradually improving its ability to make accurate predictions or decisions. In this beginner-friendly guide, you'll learn what neural network training is, how it works step by step, and why it's the foundation of modern AI. What Is a Neural Network? A neural network is a machine learning model inspired by the human brain. It consists of interconnected nodes called neurons that work together to process information. A neural network typically has three main layers: Input Layer – Receives the data. Hidden Layers – Detect patterns and relationships. Output...