Unit- 3
Module-1
Installing Python and Setting
Up Development Environments
Why Learn to Set Up a Development Environment?
Setting up your development environment correctly is the
crucial first step in your programming journey. Without the right
setup:
• You can't build or run code effectively
• You'll encounter compatibility issues
• You'll lack proper debugging tools
• You won't be able to use modern development tools
Learning Objectives
1 2
Python Installation Configure Development Environments
3 4
Introduction to Jupyter Notebooks Explore Modern Dev Tools
Installing Python – Overview
Where to Get Python
Always download Python from the official website: [Link]
Version Guide:
• Always choose Python 3.x (latest stable release)
• Avoid pre-release versions for beginners
• Latest versions include modern features like match-case and improved type hints
Python Installation on Windows
Verify Installation
Run the Installer Open Command Prompt
Download the Installer Launch the downloaded CMD) and type: python --
Visit [Link] and file and be sure to tick version
download the Windows "Add Python to PATH" -
.exe installer for the latest this is crucial! Then select You should see the
version. "Install Now". version number displayed,
confirming successful
installation.
Python Installation on macOS
Two Installation Methods
Option 1 Download installer from [Link]
Option 2 Use Homebrew (preferred by many developers):
brew install python
Verify Installation
Open Terminal and type:
python3 --version
Update pip
python3 -m pip install --upgrade pip
Python Installation on Linux
Ubuntu/Debian Installation
1. Update package lists and install Python:
sudo apt updatesudo apt install python3
python3-pip
2. Verify installation:
python3 --version
3. For newer Python versions:
sudo add-apt-repository ppa:deadsnakes/ppasudo apt install python3.12
Development Environment
Options
Text Editors Integrated Development
• VS Code Environments IDEs
• Sublime Text • PyCharm
• Atom • Thonny (beginner-friendly)
Lightweight, customisable, • Spyder
great for general coding Full-featured, powerful
debugging tools
Interactive Environments
• Jupyter Notebooks
• JupyterLab
• Google Colab
Interactive, great for data science and learning
Installing VS Code
Step-by-Step Installation
1. Download from [Link]
2. Run the installer (accept defaults)
3. Open VS Code and install the Python extension
4. Set the Python interpreter:
• Press Ctrl+Shift+P
• Type "Python: Select Interpreter"
• Choose your installed Python version
5. Create a .py file and test with a simple print statement
Virtual Environments in Python
What Are Virtual Environments?
Isolated Python environments that allow you to install Create Environment
packages for specific projects without affecting your python -m venv myenv
system-wide Python installation.
Activate Environment
Why Use Them? Windows:
• Prevents dependency conflicts between projects myenv\Scripts\activate
• Makes projects reproducible across machines macOS/Linux:
• Keeps your system Python clean source myenv/bin/activate
• Industry standard practice
Deactivate When Done
deactivate
Introduction to Jupyter Notebook
What is Jupyter Notebook?
An interactive, browser-based computing environment that allows you
to create documents containing:
• Live code execution
• Rich text explanations
• Mathematical equations
• Visualisations and plots
• Interactive widgets
Installing and Launching Jupyter
1 2
Option 1 Pip Installation Option 2 Anaconda Installation
Install directly using pip: Download and install Anaconda from [Link]
Launch through Anaconda Navigator or command line.
pip install notebook
Best for: Data scientists and beginners who want
a complete package with pre-installed libraries.
Launch with:
jupyter notebook
Best for: Users who already have Python installed
and want a lightweight installation.
Exploring the Jupyter Interface
Key Components
• Notebooks: Files with .ipynb extension
• Cells: Individual blocks that can contain:
• Code: Executable Python code
• Markdown: Formatted text
• Raw: Unformatted text
• Kernel: The Python engine that executes your code
• Toolbar: Commands for saving, adding cells, running code
Use keyboard shortcuts (e.g., Shift+Enter to run a cell) for efficient
workflow.
Introduction to Anaconda
What is Anaconda?
A distribution of Python and R programming languages for
scientific computing that aims to simplify package management
and deployment.
Key Benefits
• Pre-packaged with 1,500+ data science packages
• Includes Python, Jupyter, and popular libraries
• Built-in environment management with conda
• Navigator GUI for those who prefer not to use command line
• Available for Windows, macOS, and Linux
Download from: [Link]
Best Practices for Python Development
Always Use Virtual Keep Python and Pip Updated Use Version Control
Environments
Regularly update to the latest stable Learn Git basics and commit your code
Create a new virtual environment for versions for security patches and new regularly. Use GitHub or similar
each project to avoid dependency features. services to backup your projects.
conflicts. This is standard professional
practice.
Document Your Environment Choose the Right Tool for the Job
Create [Link] files to make your projects Use Jupyter for exploration and data analysis, but switch to a
reproducible for others (or your future self). proper IDE for building applications.
Hands-on Demo Ideas
Try These Exercises:
1. Install Python and verify with python --version
2. Create a simple "Hello World" script and run it
3. Create and activate a virtual environment
4. Install a package with pip in your virtual environment
5. Create a Jupyter notebook with code and markdown cells