ImportError: No module named Pandas

In Python, if you try to import pandas without installing the module using pip, you will get ImportError: no module named pandas error. 

In this tutorial, let’s look at installing the pandas module correctly in different operating systems and solve no module named pandas error.  

ImportError: No module named pandas

Pandas are not a built-in module (it doesn’t come with the default python installation) in Python, you need to install it explicitly using the pip installer and then use it.

If you are getting an error installing pip checkout pip: command not found to resolve the issue.

Pandas are distributed through pip as a wheel, which means you need to install wheel first and then pandas:

Install pandas in OSX/Linux 

The recommended way to install the pandas module is using pip or pip3 for Python3 if you have installed pip already.

Using Python 2

$ sudo pip install wheel
$ sudo pip install pandas

Using Python 3

$ sudo pip3 install wheel
$ sudo pip3 install pandas

Alternatively, if you have easy_install in your system, you can install pandas using the below command.

Using easy install

$ sudo easy_install -U wheel
$ sudo easy_install -U pandas

For CentOs

$ yum install python-wheel
$ yum install python-pandas

For Ubuntu

To install pandas module on Debian/Ubuntu :

$ sudo apt-get install python-wheel
$ sudo apt-get install python-pandas

Install Pandas in Windows

In the case of windows, you can use pip or pip3 based on the Python version, you have to install the pandas module.

$ pip3 install wheel
$ pip3 install pandas

If you have not added the pip to the environment variable path, you can run the below command in Python 3, which will install the pandas module. 

$ py -m pip install wheel
$ py -m pip install pandas

Leave a Reply

Your email address will not be published.

Sign Up for Our Newsletters

Subscribe to get notified of the latest articles. We will never spam you. Be a part of our ever-growing community.

You May Also Like
Check If List Is Empty Python

Check if list is empty in Python

Table of Contents Hide  How to Check if List is Empty in PythonSolution 1: Using PEP 8 recommended Style.Solution 2: Using the bool() methodSolution 3: Using the len() method.Solution 4:…
View Post
Convert Letters To Numbers In Python

Convert Letters to Numbers in Python

Table of Contents Hide Convert Letters to Numbers in PythonUsing ord() MethodUsing list comprehensionConclusion Using the ord() method, we can convert letters to numbers in Python. The ord() method returns…
View Post
Python Any()

Python any()

Table of Contents Hide any() Syntaxany() Parametersany() Return ValueExample 1 – Using any() function on Python ListsExample 2 – Using any() function on Python StringsExample 3 – Using any() function…
View Post