Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named pandas. Pandas installed pip

Tags:

I use the Mac terminal to check my package:

pip list 

I can find all packages including Pandas:

But when I

import pandas 

it told me:

ModuleNotFoundError: No module named 'pandas'

By the way, I have Python 2 and Python 3 on my Mac. They are not the same directory, and I suspect the Python interpreter didn't find the path of Pandas.

like image 333
andy Avatar asked May 17 '17 13:05

andy


People also ask

Why it is showing no module named pandas?

The error “No module named pandas ” will occur when there is no pandas library in your environment IE the pandas module is either not installed or there is an issue while downloading the module right.


1 Answers

First of all, install virtualenv inside your project folder to secure your project directory to avoid conflict with your other packages.

pip install virtualenv 

After installing this, run this command one by one inside your root project directory:

virtualenv venv source venv/bin/activate 

Now your directory is secure and you can install your required packages inside.

pip install pandas 

and others as you required.

Because you have installed virtualenv and running as secure, it will not conflict with other outside packages.

Use these all steps one by one.

like image 164
Ahmed Ginani Avatar answered Sep 20 '22 06:09

Ahmed Ginani