Skip to content
Follow
Ubuntu Linux

How to Install Pandas on Ubuntu 24.04

Richard
Written by
Richard
Dec 12, 2024 Updated Sep 15, 2026 3 min read
How to Install Pandas on Ubuntu 24.04
How to Install Pandas on Ubuntu 24.04

Pandas is a Python data analysis library that organizes messy data into rows and columns. Ubuntu 24.04 includes Python 3.12 by default, which lets you install and set up Pandas for your projects in just a couple of minutes.

Advertisement

You can add Pandas to your system through the terminal using Python’s package manager. This setup keeps your data tools ready for action without extra hassle.

⚡ Quick Answer

Install Pandas on Ubuntu 24.04 using `sudo apt update && sudo apt install python3-pandas` for the APT method, or `sudo apt install python3-pip && pip3 install pandas` for the pip method. Verify the installation by running `python3 -c “import pandas as pd; print(pd.__version__)”`.

Advertisement

Install Pandas APT

You can install Pandas using APT (Ubuntu’s native package manager) if you want a fast setup without dealing with extra installation tools. While this method gets you up and running quickly, the packaged version of Pandas might lag behind the latest release. Use this approach when you need a simple installation and do not require the absolute newest features.

APT (Ubuntu’s native package manager) installs software quickly, though the packaged version of Pandas may lag behind the latest release. Start by refreshing the local package index to ensure you pull from the latest available repositories. Run `sudo apt update` to refresh the list.

sudo apt update
sudo apt install python3-pandas

Follow that up by executing `sudo apt install python3-pandas` to pull down the library and its required dependencies. Confirm the installation by executing:

python3 -c "import pandas as pd; print(pd.__version__)"

Execution of this command displays the active version number.

Advertisement

Install pandas using pip

You can install Pandas using pip (Python's package installer) to get the newest features and most recent releases on Ubuntu 24.04. This method pulls packages directly from the Python Package Index rather than the older Ubuntu repositories. Choose this option if your project requires up-to-date functionality that the default system package manager does not provide.

First, install pip on Ubuntu.

sudo apt update
sudo apt install python3-pip

Following pip installation, import the pandas module with this command:

python
import pandas as pd

Verification of the pip installation requires running the command below.

Advertisement
print(pd.__version__)

The terminal outputs the pandas version number upon successful completion.

Install pandas using a Python virtual environment

You can install Pandas using a Python virtual environment to keep your project packages separate from the main system Python installation. This isolation prevents version clashes between different projects on Ubuntu 24.04 and protects your system environment from unintended changes. Set up a virtual environment whenever you work on multiple Python projects with different dependency needs.

First, make sure Python pip is installed and then install its virtual environment package.

sudo apt install python3-pip
sudo apt install virtualenv

Next, create a new project named project_env within the virtual environment.

Advertisement
virtualenv project_env

Then, activate the environment.

source project_env/bin/activate

After that, install pandas.

pip3 install pandas

Now, import the pandas modules.

python
import pandas as pd

Check where pandas is installed.

Advertisement
print(pd.__version__)

Once finished, deactivate the virtual environment by running the command below.

deactivate

Ubuntu 24.04 offers multiple paths for setting up Pandas depending on project requirements.

If this didn't work:

Verify that your package lists are up to date and that you have sufficient permissions to run package management commands on the system. Conflicting Python installations can require explicit use of python3 and pip3 binaries to run commands correctly.

  • APT Package Manager: Quick and straightforward, though it may not provide the latest version.
  • Pip Package Manager: Offers flexibility in managing packages and ensures you have access to the latest updates.
  • Python Virtual Environment: Ideal for project-specific installations, preventing conflicts between package versions.
  • Verification: Always verify the installation by checking the Pandas version to ensure it is installed and functioning.

Pandas remains essential for data analysis, and proper installation ensures optimal performance on Ubuntu 24.04. Utilizing `pip` guarantees access to cutting-edge features for demanding data workflows.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

Advertisement

📚 Related Tutorials

Add Multiple Clocks to Ubuntu Linux Top Bar
Ubuntu Linux Add Multiple Clocks to Ubuntu Linux Top Bar
How to Install Let's Chat on Ubuntu Linux
Ubuntu Linux How to Install Let's Chat on Ubuntu Linux
How to Change Screen Brightness in Ubuntu Linux
Ubuntu Linux How to Change Screen Brightness in Ubuntu Linux
Change Power Button Behavior in Ubuntu Linux
Ubuntu Linux Change Power Button Behavior in Ubuntu Linux

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *