ModuleNotFoundError: No module named 'pandas'
In most cases this error in Python generally raised:
- You haven't installed Pandas explicitly with pip install pandas.
- You may have different Python versions on your computer and Pandas is not installed for the particular version you're using.
So, before being able to import the Pandas module , you need to install Pandas library using pip.
Install pandas using pip
You can run the following command in your Linux/MacOS/Windows terminal.
For Python 3:
Upgrade version of Pandas
If you have already installed pandas , updating pandas would be the best solution for most cases.
Install specific version of pandas
If you want to install specific version of pandas:
Install the same Python and Pandas version
To be sure you are not having multiple Python versions that are confusing, you should run following commands:
Above command installs pandas and imports it with the same python version.
How to find the installed pandas version
After installing, you can check pandas version :
If you run into issues with privileges , you may need to run:
PIP is a package management system used to install and manage libraries/packages written in Python. Python 3.4 and Python 2.7.9 included with Pip. If you do find that pip is not available when using Python
Python 3.4+ or Python 2.7.9+ , simply execute :
If you don't have pip installed in older version of Python:
Download get-pip.py , being careful to save it as a .py file rather than .txt. Then, run it from the command prompt: