What you need before you start
Pandas is a Python library that handles data in tables and spreadsheets. Before you install it, you need Python already on your computer and a way to run commands. Most people install Pandas using pip, which is Python's package manager — it comes automatically with Python 3.4 and newer.
Check what you have by opening your terminal (Mac and Linux) or Command Prompt (Windows). Type this command and press Enter:
python --version
If you see a version number like "Python 3.9.0" or higher, you are ready. If you see an error or a version lower than 3.4, download Python from python.org and install it first. During installation on Windows, check the box that says "Add Python to PATH" — this lets your computer find Python from the command line.
Key Takeaways
- You need Python 3.4 or newer and pip (which comes with Python) before installing Pandas.
- The standard installation command is pip install pandas, which works on Windows, Mac, and Linux.
- If pip does not work, try pip3 install pandas or use Anaconda, a Python distribution that includes Pandas by default.
- After installation, test Pandas by opening Python and typing import pandas — if no error appears, the installation worked.
- Virtual environments keep Pandas separate from other projects and prevent version conflicts between your programs.
Installing Pandas with pip on any operating system
The fastest way to install Pandas is through pip. Open your terminal or Command Prompt and type this single command:
pip install pandas
Press Enter and wait. Pip will download Pandas and all the libraries it needs to run. You will see text scrolling past — this is normal. When it finishes, you will see a line that says "Successfully installed pandas" followed by a version number.
If you get an error that says "pip is not recognized" or "command not found", try this instead:
pip3 install pandas
On some computers, pip3 is the correct command. If that also fails, your Python installation may not have pip. Go back to python.org, download Python again, and make sure you check "Add Python to PATH" during setup on Windows or follow the full installation steps on Mac and Linux.
Using Anaconda if pip does not work
Anaconda is a Python distribution that comes with Pandas, NumPy, and hundreds of other data libraries already installed. If pip is giving you trouble, Anaconda is often simpler. Download it from anaconda.com, choose the version for your operating system, and run the installer.
During installation, Anaconda will ask if you want to add itself to your PATH. Say yes. After installation finishes, open a new terminal or Command Prompt and type:
conda install pandas
Conda is Anaconda's package manager and works the same way as pip. If Pandas is already installed (which it usually is with Anaconda), you will see a message saying so. You can skip this step and move straight to testing.
Anaconda takes up more disk space than a plain Python installation, but it saves time if you plan to work with data regularly. Many data scientists use it for exactly this reason.
Testing your Pandas installation
After the installation finishes, verify it worked by opening Python. Type this command in your terminal or Command Prompt:
python
You should see a prompt that looks like >>>. Now type:
import pandas
Press Enter. If nothing happens — no error message, no text — Pandas is installed correctly. Type exit() to close Python and return to your terminal.
If you see an error like "ModuleNotFoundError: No module named 'pandas'", the installation did not complete. Go back and run the pip or conda command again, and watch for any error messages during the download. Common problems include a broken internet connection, a full hard drive, or permission issues on your computer.
Installing Pandas in a virtual environment
A virtual environment is a separate folder where Python and its libraries live. It keeps Pandas and other tools isolated from the rest of your computer, so different projects can use different versions without conflicts. This is optional but recommended if you work on multiple Python projects.
To create a virtual environment, open your terminal or Command Prompt, navigate to the folder where you want to work, and type:
python -m venv myenv
Replace "myenv" with any name you want. This creates a new folder called myenv. Now activate it:
On Mac and Linux:
source myenv/bin/activate
On Windows:
myenv\Scripts\activate
Your prompt will change to show the environment name in parentheses, like (myenv) >>. Now install Pandas into this environment only:
pip install pandas
When you are done working, type deactivate to exit the virtual environment. The next time you want to use it, run the activate command again.
Fixing common installation problems
If you get a permission error on Mac or Linux, try adding --user to the end of the pip command:
pip install --user pandas
This installs Pandas for your user account only, which often works when the standard command does not.
If pip is very slow or times out, your internet connection may be unstable. Try the command again. If it keeps failing, you can tell pip to use a different server by adding -i https://mirrors.aliyun.com/pypi/simple to the end, though this is rarely necessary in North America or Europe.
If you have multiple Python versions on your computer, make sure you are using the right one. Type which python on Mac and Linux, or where python on Windows, to see which Python pip will use. If it is the wrong one, use the full path to the correct Python version instead, like /usr/bin/python3.9 -m pip install pandas.
Verifying the version and updating Pandas later
To see which version of Pandas you have, open Python and type:
import pandas as pd
print(pd.__version__)
This will show you the version number. Pandas is updated regularly with bug fixes and new features. To update to the newest version later, use:
pip install --upgrade pandas
Or in Anaconda:
conda update pandas
You do not need to uninstall the old version first — the upgrade command replaces it automatically.
Frequently Asked Questions
Do I need to install NumPy before Pandas?
No. Pandas depends on NumPy, but pip and conda handle this automatically. When you install Pandas, NumPy installs at the same time. You will never see a separate step for it.
Can I use Pandas with Python 2?
Pandas stopped supporting Python 2 in 2019. You must use Python 3.7 or newer. If you have an old project using Python 2, you will need to update it to Python 3 first.
What if I want to install a specific older version of Pandas?
Type pip install pandas==1.3.5, replacing "1.3.5" with the version you want. You can find all available versions on pypi.org by searching for pandas. This is useful if you are working with code written for an older version.
Is it safe to install Pandas on a work computer?
Pandas is open-source and widely used. Installing it does not change your system settings or require administrator access (unless your IT department has locked down Python itself). If you are unsure, ask your IT support team first.
Why does my IDE say Pandas is not installed when pip says it is?
Your code editor or IDE may be using a different Python version than the one where you installed Pandas. Check your IDE settings to point it to the correct Python installation, or reinstall Pandas using the Python path your IDE shows you.