Diagnose common setup and lesson problems before asking for help.
Troubleshooting guide
A reliable debugging process
- Read the last line of the error first.
- Find the line in your code named by the traceback.
- Compare the actual value with the value you expected.
- Reproduce the smallest failing example.
- Change one thing.
- Run again and record what changed.
Do not delete the whole project or randomly reinstall packages before identifying the failure.
Common problems
| Symptom | Likely cause | First action |
|---|---|---|
python: command not found |
Python is not installed or not on PATH | Try python3 --version, then follow the official Python installation guide. |
ModuleNotFoundError |
Package is missing from the active environment | Activate .venv, then install the named package with python -m pip install package-name. |
| Notebook cells use old values | Kernel state is out of order | Restart the kernel and run all cells from the top. |
NameError |
A name was misspelled or its defining cell did not run | Check spelling and run the setup cell. |
TypeError |
An operation received the wrong kind of value | Print the values and their types with type(value). |
| Empty chart | Data is empty or the plot was not displayed | Print the data and run plt.show(). |
| API authentication failure | Missing, expired, or incorrectly named environment variable | Check the variable name without printing the secret. |
| Git merge conflict | Two edits changed the same lines | Read both versions, choose deliberately, then commit the resolution. |
Ask for help well
Include:
- the lesson and step;
- the smallest code that fails;
- the complete error message;
- what you expected;
- what you already tried;
- your operating system and Python version.
Never include passwords, API keys, private student data, or full secret environment files.
Resetting a notebook
When results seem inconsistent:
- Save useful notes.
- Restart the kernel.
- Run all cells in order.
- Remove hidden state and unused imports.
- Recheck the smallest example.