Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: Missing required dependencies ['numpy']

I was able to run all scripts successfully which is using pandas , but suddenly all my PANDAS SCRIPTS are giving this error :

Traceback (most recent call last):

File "data_visulaization.py", line 5, in

import pandas as pd

File "/usr/lib64/python2.7/site-packages/pandas/init.py", line 18, in

raise ImportError("Missing required dependencies {0}".format(missing_dependencies))


ImportError: Missing required dependencies ['numpy']

Recently i have not installed or updated any new things.

Does anyone have a solution for this?

I uninstalled pandas and numpy and re-installed them but still facing the same issue.

like image 537
aAAAAAAa Avatar asked Mar 23 '17 10:03

aAAAAAAa


People also ask

What are the dependencies of NumPy?

NumPy doesn't depend on any other Python packages, however, it does depend on an accelerated linear algebra library - typically Intel MKL or OpenBLAS. Users don't have to worry about installing those (they're automatically included in all NumPy install methods).

Is pandas dependency on NumPy?

Pandas is built on top of NumPy, which means the Python pandas package depends on the NumPy package and also pandas intended with many other 3rd party libraries. So we can say that Numpy is required for operating the Pandas.

How do I check NumPy version in Anaconda prompt?

Make sure you are using the Anaconda prompt, as the conda command only works in an Anaconda environment, and type conda list numpy . The result will show the version of numpy and associated packages.


1 Answers

I got this issue on Rasberry PI and found that the root cause was missing library:

import numpy
...
ImportError: libf77blas.so.3: cannot open shared object file: No such file or directory

Then it takes few minute to google the required library source:

sudo apt-get install libatlas-base-dev

I have not checked the solution on any other Linux-es but likely the same method should be applicable. So try to import the faulty library first and see what is missing.

like image 116
Shtefan Avatar answered Oct 05 '22 22:10

Shtefan