How to Install Python, Jupyter Notebook and VS Code for Data Science (Windows and Mac)
P1.5 Common Python Install Errors and How to Fix Them
Why. Almost every student meets one of these errors. Knowing the fix keeps you moving.
What. Most errors come from three causes: Python is not on the PATH, two Pythons are installed, or a package was installed into a different Python.
| Error message | Cause | Fix |
|---|---|---|
| python is not recognized | PATH not set (Windows) | Reinstall, tick Add python.exe to PATH |
| command not found: python | Mac uses python3 | Type python3 and pip3 |
| ModuleNotFoundError: No module named pandas | pandas not installed in this Python | Run pip install pandas in the same Python |
| jupyter is not recognized | Jupyter not installed or not on PATH | Run python -m notebook |
How to read this table: each row is one error. Read the message, find its cause, then do the fix.
How.
When a package seems missing
- Check which Python runs:
python -c "import sys; print(sys.executable)". - Install with that same Python:
python -m pip install pandas. - In Jupyter, restart the kernel (Kernel → Restart).
- Run the import again.
Worked example A — See which Python you are using.
Step 1 — What we do. We print the full path of the running Python. This answers "which Python is this?"
Step 2 — Type and run this code.
import sys
print(sys.version.split()[0])
Step 3 — Output you should see.
3.13.5
Step 4 — What it means. sys.version is the version of the Python that runs this code. If your terminal and Jupyter show different versions, they are two different Pythons.
Worked example B — An intended error: a missing module.
Step 1 — What we do. We import a package that does not exist, to see the error message calmly.
Step 2 — Type and run this code.
import blinkit_magic
Step 3 — Output you should see.
ModuleNotFoundError: No module named 'blinkit_magic'
Step 4 — What it means. Read the last line of any error first. It names the problem. Here the fix would be to install the package or correct the spelling.
Ravindra Bagale's Tip
Use python -m pip install instead of plain pip install. It installs into the same Python that runs your code, so "installed but not found" mostly disappears.
Ravindra Bagale's Tip – मराठी
साध्या pip install ऐवजी python -m pip install वापरा. Code चालवणाऱ्या त्याच Python मध्ये install होतं, त्यामुळे "install केलं पण सापडत नाही" हा प्रश्न बहुतेक संपतो.
Ravindra Bagale's Tip – हिंदी
सादे pip install की जगह python -m pip install इस्तेमाल करो. Code चलाने वाले उसी Python में install होता है, तो "install किया पर मिल नहीं रहा" वाली दिक्कत ज़्यादातर खत्म.
Samajla ka? If yes, take the quiz for this chapter. If not, run every example again and change one value each time.