Evolve AI Institute

Python and Libraries Installation Guide

Lesson 4: Introduction to Neural Networks

Table of Contents

  1. Python Installation
  2. Required Libraries
  3. Jupyter Notebook Setup
  4. Verification
  5. Troubleshooting
  6. Alternative: Google Colab

Python Installation

Windows

Option 1: Official Python.org (Recommended)

  1. Download Python
    • Go to python.org/downloads
    • Download Python 3.10 or later (3.11 recommended)
    • Choose "Windows installer (64-bit)"
  2. Run Installer
    IMPORTANT: Check "Add Python to PATH"
    • Click "Install Now"
    • Wait for installation to complete
    • Click "Close" when done
  3. Verify Installation
    • Open Command Prompt (search "cmd" in Start menu)
    • Type: python --version
    • Should see: Python 3.11.x (or your version)

Option 2: Anaconda (Includes Everything)

  1. Download Anaconda
  2. Install
    • Run the downloaded file
    • Accept default settings
    • Installation takes 10-15 minutes
  3. Verify
    • Open "Anaconda Prompt" from Start menu
    • Type: python --version
    • Type: conda --version

macOS

Option 1: Official Python.org

  1. Download Python - Go to python.org/downloads, download macOS installer, open the .pkg file
  2. Install - Follow installation wizard, use default settings, enter password when prompted
  3. Verify - Open Terminal, type: python3 --version

Option 2: Homebrew (Recommended for developers)

  1. Install Homebrew (if not already installed)
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Install Python
    brew install python
  3. Verify
    python3 --version

Linux (Ubuntu/Debian)

Most Linux distributions come with Python pre-installed. To ensure you have the latest version:

# Update package list
sudo apt update

# Install Python 3.11
sudo apt install python3.11 python3-pip

# Verify
python3 --version
pip3 --version

Required Libraries

Method 1: pip install (Quick Setup)

Open Terminal/Command Prompt and run:

# Install all required packages at once
pip install numpy matplotlib scikit-learn jupyter seaborn pandas

# Or install individually:
pip install numpy        # Numerical computing
pip install matplotlib   # Plotting and visualization
pip install scikit-learn # Machine learning library
pip install jupyter      # Interactive notebooks
pip install seaborn      # Statistical visualization
pip install pandas       # Data manipulation

For Windows: Use pip instead of pip3
For macOS/Linux: Use pip3 instead of pip

Method 2: Anaconda (If using Anaconda)

# These are already included in Anaconda:
conda install numpy matplotlib scikit-learn jupyter seaborn pandas

# If any are missing:
conda install -c conda-forge <package_name>

Method 3: requirements.txt (For classrooms)

  1. Create a file named requirements.txt with:
    numpy>=1.24.0
    matplotlib>=3.7.0
    scikit-learn>=1.3.0
    jupyter>=1.0.0
    seaborn>=0.12.0
    pandas>=2.0.0
  2. Install all at once:
    pip install -r requirements.txt

Jupyter Notebook Setup

Starting Jupyter

Method 1: Command Line

# Navigate to your project folder
cd /path/to/your/project

# Start Jupyter
jupyter notebook

# Your browser should open automatically
# If not, copy the URL shown in terminal (e.g., http://localhost:8888)

Method 2: Anaconda Navigator (Windows)

  1. Open Anaconda Navigator from Start menu
  2. Click "Launch" under Jupyter Notebook
  3. Browser opens automatically

Method 3: VS Code

  1. Install VS Code: code.visualstudio.com
  2. Install Python extension
  3. Install Jupyter extension
  4. Open .ipynb files directly in VS Code

Creating Your First Notebook

  1. In Jupyter browser interface, click "New" → "Python 3"
  2. Save as "neural-networks-test.ipynb"
  3. Test with:
    import numpy as np
    print("Hello, Neural Networks!")
    print(f"NumPy version: {np.__version__}")

Verification

Complete Verification Script

Copy this into a new Jupyter notebook cell or Python file:

# Verification Script for Lesson 4
import sys

print("=" * 50)
print("LESSON 4: Neural Networks Setup Verification")
print("=" * 50)
print()

# Python version
print(f"Python version: {sys.version.split()[0]}")
if sys.version_info < (3, 8):
    print("  Warning: Python 3.8+ recommended")
print()

# Required packages
packages = {
    'numpy': 'NumPy',
    'matplotlib': 'Matplotlib',
    'sklearn': 'scikit-learn',
    'jupyter': 'Jupyter',
    'seaborn': 'Seaborn',
    'pandas': 'Pandas'
}

all_good = True
for module, name in packages.items():
    try:
        if module == 'sklearn':
            import sklearn
            version = sklearn.__version__
        else:
            imported = __import__(module)
            version = imported.__version__
        print(f"{name:<15} version {version}")
    except ImportError:
        print(f"{name:<15} NOT INSTALLED")
        all_good = False

print()
if all_good:
    print("All packages installed successfully!")
    print("You're ready for Lesson 4!")
else:
    print("Some packages are missing.")
    print("Please install missing packages using:")
    print("pip install <package_name>")

Expected Output

==================================================
LESSON 4: Neural Networks Setup Verification
==================================================

Python version: 3.11.5
NumPy          version 1.24.3
Matplotlib     version 3.7.2
scikit-learn   version 1.3.0
Jupyter        version 1.0.0
Seaborn        version 0.12.2
Pandas         version 2.0.3

All packages installed successfully!
You're ready for Lesson 4!

Troubleshooting

Common Issues and Solutions

Issue 1: "pip is not recognized"

Windows:

python -m pip install numpy

macOS/Linux:

python3 -m pip install numpy

Issue 2: Permission denied

macOS/Linux:

pip3 install --user numpy matplotlib scikit-learn

Windows: Run Command Prompt as Administrator

Issue 3: Multiple Python versions

# Check which Python you're using:
which python    # macOS/Linux
where python    # Windows

# Use specific version:
python3.11 -m pip install numpy

Issue 4: Jupyter doesn't start

# Reinstall Jupyter
pip install --upgrade jupyter

# Or use specific command
python -m jupyter notebook

Issue 5: Import errors in Jupyter

Restart kernel: In Jupyter: Kernel → Restart

# Check Python path:
import sys
print(sys.executable)
print(sys.path)

Issue 6: Slow installation

# Use a faster mirror:
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple

Issue 7: SSL Certificate errors

pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org numpy

Getting Help

  1. Check Python version: Must be 3.8 or higher
  2. Update pip: python -m pip install --upgrade pip
  3. Search error message: Copy exact error to Google
  4. Ask for help:

Alternative: Google Colab

No installation needed! Use Google Colab for cloud-based Jupyter notebooks.

Advantages

Getting Started

  1. Go to: colab.research.google.com
  2. Sign in with Google account
  3. Click: File → New Notebook
  4. Or Upload: Upload the lesson .ipynb file

Using Our Lesson Files in Colab

# In first cell of Colab notebook:
!pip install --upgrade numpy matplotlib scikit-learn seaborn

# Then run the lesson code as normal

Saving Your Work

Classroom Setup Guide (For Teachers)

Option 1: Individual Student Setup

Week before lesson:

  1. Send installation guide to students
  2. Have students run verification script
  3. Troubleshoot issues during office hours

Day of lesson:

  1. Quick verification check (5 minutes)
  2. Backup: Have Google Colab ready

Option 2: Lab Computer Setup

# Run on each computer:
pip install numpy matplotlib scikit-learn jupyter seaborn pandas

# Verify on each:
python verification_script.py

Option 3: Cloud-Based (Recommended)

Use Google Colab for entire class:

Backup Plan

Always have ready:

  1. Pre-installed USB drives with Python
  2. Google Colab links
  3. Pre-run notebooks with outputs saved
  4. Screenshots of expected results

Next Steps

Once installation is complete:

  1. Run verification script
  2. Open neural-networks-starter.ipynb
  3. Follow along with lesson
  4. Experiment with code
  5. Complete exercises
  6. Build your first neural network!

Additional Resources

Learning Resources

Community Help

Questions? Contact us at info@evolveaiinstitute.com