- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How do I know if Python has pandas installed?
To check whether the pandas package is installed or not in python we can simply verify the version. To get the version details of pandas we have two options.
The first one is using the __version__ attribute.
Example
import pandas as pd print(pd.__version__)
Explanation
To verify the version number of pandas, we can use this __version__ built-in attribute provided by pandas, this will return you the number specifying which version of pandas we have.
Output
1.1.5
The number 1.1.5 represents the version of pandas that is already available.
The second way is using the pandas show_versions() method.
Example
print(pd.show_versions())
show_versions() is a pandas method that will not only give you the information about pandas version, it also provides the details about versions of python and pandas dependent packages and OS Type.
Output
INSTALLED VERSIONS ------------------ commit : b5958ee1999e9aead1938c0bba2b674378807b3d python : 3.8.3.final.0 python-bits : 32 OS : Windows OS-release : 10 Version : 10.0.19041 machine : AMD64 processor : Intel64 Family 6 Model 78 Stepping 3, GenuineIntel byteorder : little LC_ALL : None LANG : None LOCALE : English_United States.1252 pandas : 1.1.5 NumPy : 1.19.4 pytz : 2020.1 dateutil : 2.8.1 pip : 20.3.3 setuptools : 41.2.0 Cython : None pytest : None hypothesis : None sphinx : None blosc : None feather : None xlsxwriter : None lxml.etree : None html5lib : None pymysql : None psycopg2 : None jinja2 : 2.11.2 IPython : 7.19.0 pandas_datareader : None bs4 : None bottleneck : None fsspec : None fastparquet : None gcsfs : None matplotlib : 3.3.3 numexpr : None odfpy : None openpyxl : None pandas_gbq : None pyarrow : None pytables : None pyxlsb : None s3fs : None scipy : 1.5.4 sqlalchemy : None tables : None tabulate : None xarray : None xlrd : None xlwt : None numba : None
The above block represents the version of all pandas dependents and python.
You will find an error message if we don’t have the pandas package. The error message will be like this.
ModuleNotFoundError
The above error will rise when python cannot successfully import a module. In our situation, there may be a chance that we have not yet installed the pandas package or it may be a spelling mistake.
If you found this above error, then install the pandas package. These are the two ways to identify if pandas installed or not.
- Related Articles
- How do I know which MongoDB version is installed using the Command Line?
- How Do I Know if I Have Herpes or Something Else?
- How do I check if a string has alphabets or numbers in Python?
- How to know if an object has an attribute in Python?
- Python Pandas - Check if the index has NaNs
- How can I get a list of locally installed Python modules?
- Python Pandas - Check if the index has unique values
- Python Pandas - Check if the index has duplicate values
- Python Pandas - Check if the IntervalIndex has overlapping intervals
- How do I know if a MySQL table is using myISAM or InnoDB Engine?
- How do I get the resource id of an image if I know its name in Android?
- How do I check if a Python variable exists?
- How Do I Know I’m Really Addicted to Nicotine?
- How do I get the resource id of an image if I know its name in Android using Kotlin?
- How Do You Know if It\'s Parkinson\'s Disease?
