How to Find the Installed Pandas Version

Luqman Khan Feb 02, 2024
  1. Use pd.__version__ to Find the Installed Pandas Version
  2. Use pd.show_versions() to Find the Version of the Pandas Dependencies
  3. Find the Installed Pandas Version in Command or Shell Mode
  4. Conclusion
How to Find the Installed Pandas Version

Pandas is one of the frequently used Python libraries for data analysis, which needs Pandas version updates regularly. Other Pandas’ needs are incompatible as a result of this.

Let’s look at the methods for determining the Pandas version and dependencies on any system.

Use pd.__version__ to Find the Installed Pandas Version

We can verify the version of Pandas running on any machine using pd.__version__. First, it is necessary to import the Python Pandas package.

The word __version__ has a double underscore before and after.

import pandas as pd

print(pd.__version__)

Output:

1.3.5

The output shows the version installed, which is 1.3.5.

Use pd.show_versions() to Find the Version of the Pandas Dependencies

To verify the version of the dependencies, we may use the utility function pd.show_versions().

import pandas as pd

pd.show_versions()

Below are all dependencies of the Python Pandas package.

Output:

INSTALLED VERSIONS
------------------
commit           : 66e3805b8cabe977f40c05259cc3fcf7ead5687d
python           : 3.7.12.final.0
python-bits      : 64
OS               : Linux
OS-release       : 5.4.144+
Version          : #1 SMP Tue Dec 7 09:58:10 PST 2021
machine          : x86_64
processor        : x86_64
byteorder        : little
LC_ALL           : None
LANG             : en_US.UTF-8
LOCALE           : en_US.UTF-8

pandas           : 1.3.5
numpy            : 1.21.5
pytz             : 2018.9
dateutil         : 2.8.2
pip              : 21.1.3
setuptools       : 57.4.0
Cython           : 0.29.28
pytest           : 3.6.4
hypothesis       : None
sphinx           : 1.8.6
blosc            : None
feather          : 0.4.1
xlsxwriter       : None
lxml.etree       : 4.2.6
html5lib         : 1.0.1
pymysql          : None
psycopg2         : 2.7.6.1 (dt dec pq3 ext lo64)
jinja2           : 2.11.3
IPython          : 5.5.0
pandas_datareader: 0.9.0
bs4              : 4.6.3
bottleneck       : 1.3.4
fsspec           : None
fastparquet      : None
gcsfs            : None
matplotlib       : 3.2.2
numexpr          : 2.8.1
odfpy            : None
openpyxl         : 3.0.9
pandas_gbq       : 0.13.3
pyarrow          : 6.0.1
pyxlsb           : None
s3fs             : None
scipy            : 1.4.1
sqlalchemy       : 1.4.31
tables           : 3.7.0
tabulate         : 0.8.9
xarray           : 0.18.2
xlrd             : 1.1.0
xlwt             : 1.3.0
numba            : 0.51.2

Find the Installed Pandas Version in Command or Shell Mode

Below are other methods for obtaining the version via a Windows command and a Linux Shell/Mac OS terminal. Conda requires the Anaconda distribution to be installed on your system.

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

# Anaconda utility Conda
conda list | findstr pandas

# By using pip
pip freeze | findstr pandas
pip show pandas | findstr Version

Conclusion

You’ve learned the techniques for getting or finding installed versions of Pandas. These may be used on any operating system that supports Python, pip, Anaconda, Linux, Windows, and Mac.

You’ve discovered how to get the version programmatically by using the __version__ property and the show_versions() method.

Related Article - Pandas Version