SyntaxError or NameError
- Python
You may see
Why it happens
- A missing
:after if, for, while, def or else. - An open bracket or quote, often on the line above.
- A misspelt name.
How to fix it
- Look at the line with the ^ and the one above it.
- Close every bracket and quote.
- Copy the block again with the Copy button if unsure.
It worked if: The program starts.
Related errors
Tutorials where it can happen
- Annotation & Labelling: Writing the Answer Key 🔒
- Auto Highlight Reel 🔒
- Automation Pipelines & Triggers: Ring the Doorbell 🔒
- Automation Stress Test: A Fire Drill for Your System 🔒
- Bias, Fairness & the Model Card 🔒
- Capstone Data Sprint: Capture & Annotate 🔒
38 more
- Capstone: Model Training, Iteration & AI Feedback 🔒
- Claude as Your Match Commentator 🔒
- Claude Vision & Multimodal AI 🔒
- Clean the Field Data & Retrain 🔒
- CNNs: How Convolutional Layers See 🔒
- Computer Vision to Arduino or ESP32 🔒
- Contours & Colour Tracking: Follow the Ball 🔒
- Demo Day: Your Live Product Showcase 🔒
- Evaluation: The Metrics That Matter 🔒
- Field Trip 1: Capturing Football Data on a Real Pitch 🔒
- Field Trip 2: Deploying at a Live Sports Event 🔒
- Field Trip 3: The Final Deployment Test 🔒
- Filters, Thresholds & Edges: Classic Computer Vision 🔒
- Formation & Tactical Analysis 🔒
- Homography: From Camera View to Pitch Map 🔒
- How Neural Networks Learn: Walking Downhill in Fog 🔒
- How to Create a Flask Server with Python using a Raspberry Pi
- Images, Pixels & Colour Spaces: Finding the Pitch with HSV 🔒
- Live Data Debrief: What Really Happened? 🔒
- Motion Detection & Background Subtraction 🔒
- Object Detection: How YOLO Finds Things 🔒
- Object Tracking: Following Players 🔒
- Overfitting & the Bad-Data Lab 🔒
- Player Heatmaps: Footprints in the Snow 🔒
- Pose Estimation with MediaPipe 🔒
- Python & NumPy Crash Course: An Image Is an Array
- Python & OpenCV: Set Up Your Computer-Vision Workshop
- Real-Time Detection: Making It Fast on a Laptop 🔒
- Speed & Distance Estimation 🔒
- Train a Custom Sports Detector with YOLO 🔒
- Train Your First Image Classifier: Ball or No Ball 🔒
- Train, Validation & Test Splits, and Augmentation 🔒
- Transfer Learning: Standing on Giants' Shoulders 🔒
- Video Basics: Frames, FPS, Reading & Saving Video 🔒
- Webcam Data Capture: A Camera Trap for Your Dataset 🔒
- What is Computer Vision? See, Decide, Act
- What Makes Good Sports Data? 🔒
- Zone Detection & Spatial Logic 🔒
Seen in a real run (some lines are close variants of it). Produced with Python 3.13 on Windows.
Didn't help? Search another error or ask us.

