DEV Community

Srinivas for ItsMyCode

Posted on • Originally published at itsmycode.com on

ImportError: No module named Pandas

ItsMyCode |

In Python, if you try to import _pandas_without installing the module using pip, you will get 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 is 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 pip installed already.

Using Python 2

$ sudo pip install wheel
$ sudo pip install pandas
Enter fullscreen mode Exit fullscreen mode

Using Python 3

$ sudo pip3 install wheel
$ sudo pip3 install pandas
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

For CentOs

$ yum install python-wheel
$ yum install python-pandas
Enter fullscreen mode Exit fullscreen mode

For Ubuntu

To install pandas module on Debian/Ubuntu :

$ sudo apt-get install python-wheel
$ sudo apt-get install python-pandas
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

If you have not added the pip.exe 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
Enter fullscreen mode Exit fullscreen mode

The post ImportError: No module named Pandas appeared first on ItsMyCode.

Discussion (0)