
You’re excited to start your first data science project, you type import pandas as pd, run your script, and… crash. The error message reads ModuleNotFoundError: pandas, leaving you baffled.
ModuleNotFoundError: No module named 'pandas'
It just means Python can’t find the Pandas library on your computer. Don’t panic. Errors like ModuleNotFoundError: pandas are among the easiest to fix.
⚡ Quick Fix: ModuleNotFoundError: No module named ‘pandas’ — Python pip Install Fix for Virtual Environments and Multiple Python Versions
Python can’t find Pandas because you haven’t installed it yet, installed it in the wrong environment, or installed it for a different Python version.
# Run this in your terminal first pip install pandas # Still failing? Install for the exact Python interpreter you're running python -m pip install pandas # On Mac/Linux pip3 install pandas
If pip install pandas didn’t fix it, Cause 2 and Cause 3 below will tell you exactly what’s wrong with your environment setup.
Cause 1: You Haven’t Installed It Yet (Most Common)
Python does not come with Pandas pre-installed. You must install it yourself using pip, Python’s package manager.
The Fix: Open your terminal or command prompt and run:
pip install pandas
(Mac/Linux users might need pip3 install pandas or python3 -m pip install pandas).
Wait for the installation to finish, then try running your script again. This should resolve your ModuleNotFoundError: pandas issue if it wasn’t installed.
Cause 2: You’re in the Wrong Environment
If you know you installed it, but it still fails, you are likely using the wrong Virtual Environment or Python interpreter.
You might have installed Pandas globally, but your IDE (like VS Code or PyCharm) is actively running inside a new virtual environment where it’s not installed yet.
The Fix:
- Check your IDE’s bottom status bar to see which Python interpreter is selected.
- Make sure you activated your virtual environment in the terminal before running
pip install pandas.Otherwise, you might face the ModuleNotFoundError: pandas.
Cause 3: Multiple Python Versions Confusion
You might have Python 3.10 and Python 3.12 both installed. You installed pandas for 3.10, but you are running your script with 3.12.
The Fix: Instead of just pip install pandas, try being specific about which Python you are using:
# Installs for the specific 'python' currently active python -m pip install pandas
This is often safer than just typing pip to avoid the ModuleNotFoundError: pandas when running scripts with different versions.
Summary
99% of the time, this error just means you forgot to run pip install pandas. Do that first to tackle ModuleNotFoundError: pandas!
Fix ModuleNotFoundError: No module named ‘pandas’ — Three Checks, Done in 60 Seconds
Run pip install pandas first. That single command fixes the error for 99% of developers hitting this page.
Still broken? Run python -m pip install pandas instead of bare pip. This targets the exact Python interpreter your script runs with and eliminates version mismatch as the cause.
Still broken after that? Check your IDE’s status bar. VS Code and PyCharm both display the active interpreter in the bottom-left corner. If it points at a virtual environment, activate that environment in your terminal, then run the install command again inside it.
Three checks, three minutes. ModuleNotFoundError: No module named ‘pandas’ has no fourth cause worth worrying about at this stage.
Ready to use Pandas? The guide on reading a CSV file with Pandas picks up exactly where this page leaves off — DataFrames, column selection, and real data in under 10 minutes.





