How to change Pandas version

In this tutorial you will learn how to change pandas version.

How to uninstall the current version?

Optional: You can start by uninstalling the currently installed version of Pandas. To uninstall Pandas, use the following command:

pip uninstall pandas

How to change Pandas version?

There may be times when you want to use a specific version of Pandas. The project requires it. A specific version contains the functionality you need. There can be many reasons and they are not important. Most importantly, you have the option to choose the Pandas library on your computer.

To change the version of Pandas on your computer, use the following command.

pip install pandas==1.2.3

Replace 1.2.3 with the version of Pandas you want to use. You can find a list of available versions on the Pandas PyPI page: https://pypi.org/project/pandas/#history

How to upgrade Pandas to the latest version?

To downgrade pandas to the latest version you will need the following command.

pip install --upgrade pandas

Pip will install the latest available version for you.

How to check Pandas version?

To check the version of Pandas you have installed, use the following code.

import pandas as pd

print(pd.__version__)

This will print the version number of Pandas that is currently installed.

How to change Pandas version in Conda?

Open your conda environment in your terminal:

conda activate <environment_name>

Replace <environment_name> with the name of your conda environment.

Uninstall the current version of Pandas:

conda remove pandas

Install the desired version of Pandas:

conda install pandas=<version_number>

Replace <version_number> with the version of Pandas that you want to install. You can find a list of available versions on the Pandas conda page: https://anaconda.org/anaconda/pandas/files

Verify that the correct version of Pandas is installed:

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

This will print the version number of Pandas that is currently installed.

I gave you commands on how to change pandas version using pip tool. There are many other methods, and it works similarly in all of them. You can change Pandas versions with one simple command.

This Post Has One Comment

Leave a Reply