How to check the pandas version in Python

Before working with pandas, we must ensure the correct version is installed on our system. We can check if the correct pandas version is installed using the following ways.

  • Use the pip show command

  • Use the __version__ attribute

Method 1: Use the pip show command

Let's look at how to check the currently installed version of pandas using the pip show command.

  • Install the pandas library using the pip3 install pandas command.

  • Use the pip show pandas command to get information about the pandas package, including the version.

Method 2: Use the __version__ attribute

Let's look at how to check the currently installed version of pandas using the __version__ attribute.

  • As we have already installed the pandas, we now execute the python3 command to enter the Python environment.

  • Import the pandas library using the import pandas as pd command.

  • Print the __version__ attribute of the pandas using the print(pd.__version__) command to check the currently installed version of pandas.

  • Execute the exit() command to exit the Python environment.

Playground

Run any of the methods listed above in the terminal below to check the installed pandas version.

Note: We have already installed Python in the terminal below. Execute the command python3 --version to check the Python version.

Terminal 1
Terminal
Loading...

Conclusion

We have discussed two methods to check the pandas version. Using any of these methods, we can easily check and ensure that we have installed the system's correct version of the pandas.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved