4Geeks chosen to deliver AI education in the Bahamas alongside Harvard, Oxford, and Columbia.See more

How to install Python Pandas with pip (Windows, Mac, Linux)

By 4Geeks

Install pandas 3.1 in your terminal, Jupyter or VS Code, check it with your first DataFrame and avoid the usual errors.

6 min readLast updated
Install pandas icon

How to install pandas in Python

Short answer: Open a terminal and run python -m pip install pandas on Windows or python3 -m pip install pandas on macOS and Linux, ideally inside a virtual environment. In Jupyter, type %pip install pandas in a cell. The latest version is pandas 3.1.1, released on November 4, 2026, and it needs Python 3.11 or newer. Check the install with python -c "import pandas as pd; print(pd.__version__)".

pandas is the Python library for working with tables of data: reading CSV and Excel files, cleaning columns, filtering rows and calculating summaries. It does not come with Python, so you install it with pip, the package installer.

pip installs pandas together with numpy and python-dateutil, the libraries it needs. Inside a virtual environment you never touch the system Python.

Installing pandas at a glance

Where you workCommand
Windows terminalpython -m pip install pandas
macOS or Linux terminalpython3 -m pip install pandas
Active virtual environmentpip install pandas
Jupyter Notebook or JupyterLab%pip install pandas
Anaconda or Minicondaconda install -c conda-forge pandas
uv projectuv add pandas
With Excel supportpip install "pandas[excel]"

Step 1: check Python and pip

pandas 3.1 works with Python 3.11 or newer. Check your version:

bash
python --version            # Windows
python3 --version           # macOS and Linux
python -m pip --version     # pip, with python3 on macOS and Linux

If you do not have Python or your version is older than 3.11, first follow the guide to install Python.

Step 2: create a virtual environment

A virtual environment keeps pandas inside your project folder. On Ubuntu, Debian and macOS with Homebrew it is almost required, because pip refuses to install packages into the system Python.

On Windows, in PowerShell:

powershell
python -m venv .venv
.venv\Scripts\activate

On macOS and Linux:

bash
python3 -m venv .venv
source .venv/bin/activate

You will see (.venv) at the start of the line. From here on, python and pip belong to the environment.

Step 3: install pandas

bash
pip install pandas

pip downloads pandas and the libraries it needs. The last line confirms what was installed:

Successfully installed numpy-2.5.4 pandas-3.1.1 python-dateutil-4.0.0 tzdata-2026.6

Step 4: check that it works

Create a file called test_pandas.py with this code and run it with python test_pandas.py:

python
import pandas as pd
 
print(pd.__version__)
 
df = pd.DataFrame({"product": ["Coffee", "Tea", "Water"], "price": [2.5, 2.0, 1.0]})
print(df)
print(df["price"].mean())
3.1.1
  product  price
0  Coffee    2.5
1     Tea    2.0
2   Water    1.0
1.8333333333333333

import pandas as pd is the usual way to import it, and pd is the name you will see in every example and in the documentation.

Career · AI Engineering

You have pandas, now build something with your data

From zero to junior AI Engineer: Python, data, AI agents and RAG with mentors and real projects.

Install pandas in Jupyter, VS Code and Google Colab

Jupyter Notebook and JupyterLab: type %pip install pandas in a cell. The % installs pandas into the same Python the notebook uses. Then restart the kernel from the Kernel > Restart menu.

VS Code: open the command palette with Ctrl+Shift+P (Cmd+Shift+P on Mac), search for Python: Select Interpreter and pick the Python in your .venv. If VS Code uses another Python, you will see No module named 'pandas' even though you installed it.

Google Colab: pandas comes preinstalled. Check it with pd.__version__, and if you need another version, run %pip install pandas==3.1.1 and restart the session.

Install pandas with conda or uv

If you use Anaconda or Miniconda, install pandas with conda from the conda-forge channel, inside your environment:

bash
conda create -n data python
conda activate data
conda install -c conda-forge pandas

With uv, pandas is added to the project and recorded in pyproject.toml:

bash
uv init my-project
cd my-project
uv add pandas
uv run python -c "import pandas as pd; print(pd.__version__)"

Update pandas or install a specific version

bash
pip install --upgrade pandas      # to the latest version
pip install pandas==3.0.6         # a specific version
pip show pandas                   # installed version and location

If a project includes a requirements.txt file, install exactly what it asks for with pip install -r requirements.txt.

Which pandas pip installs for your Python

pip picks the latest pandas release that supports your Python:

Your Pythonpandas version you get
3.11, 3.12, 3.13, 3.14 or 3.153.1.1
3.9 or 3.102.3.3

If pd.__version__ shows a version 2 and you want 3, the problem is your Python: update it and create the virtual environment again.

Install pandas with help from AI

An assistant such as ChatGPT, Claude or GitHub Copilot fixes install errors quickly when you give it the full context. These three prompts are ready to copy.

1. Fix an install error

When I run [pip install pandas] on [Windows / macOS / Ubuntu] I get this error:
[paste the full message]
My Python is [output of python --version] and I use [terminal / VS Code / Jupyter].
Explain the cause and give me the steps to fix it.

2. Set up a data analysis project

Help me create a data analysis project with Python 3.15 on [system]:
a virtual environment, pandas, Excel support and a script that reads [sales.csv] and prints a summary.
Give me the commands one by one.

3. Explain your first DataFrame

I am new to pandas. Explain this code line by line and what it prints:
[paste your code]
Then suggest 3 short exercises with the same DataFrame.

Always check that the commands are for your system and that you install inside your virtual environment.

Learn with a mentor

From data tables to AI applications

In the 4Geeks AI Engineering career program you start with no experience and finish with AI agents and RAG systems in your portfolio.

Common errors when installing pandas

What you seeWhy it happensFix
ModuleNotFoundError: No module named 'pandas'You installed pandas into another Python, not the one running your codeInstall with python -m pip install pandas using the same python, or pick the right interpreter in VS Code
'pip' is not recognized as an internal or external commandpip is not on your Windows PATHUse python -m pip install pandas
error: externally-managed-environmentUbuntu, Debian and Homebrew protect the system PythonCreate a virtual environment and install pandas inside it
An ImportError that mentions openpyxl when reading Excelpandas needs openpyxl for .xlsx filesRun pip install openpyxl or pip install "pandas[excel]"
pd.__version__ shows 2.3.3Your Python is 3.9 or 3.10, and pandas 3 needs 3.11 or newerUpdate Python and create the environment again
Microsoft Visual C++ 14.0 or greater is requiredpip tries to build pandas because there is no ready-made version for your PythonUse a supported Python version, such as 3.15
Free download

Installing pandas in a 2-page cheat sheet

The commands for the terminal, Jupyter, VS Code, conda and uv, which version you get for your Python, the most common errors and prompts for ChatGPT, Claude or Copilot. Free, in PDF.

How to install pandas cheat sheet

2 pages · PDF · 4Geeks

  • The exact command for every environment
  • Which pandas you get for your Python version
  • The 6 most common errors and prompts to fix them with AI

Get it free

Your PDF right away

Frequently asked questions about installing pandas

Want to go from analyzing data with pandas to building AI apps, with real projects and mentors?

See the AI Engineering program