ImportError: Missing required dependencies ['numpy']

I managed to successfully run all the scripts using pandas, but suddenly all my pandas SCRIPTS throw this error:

Traceback (last last call):

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'] 

I have not recently installed or updated any new things.

Does anyone have a solution for this?

I uninstalled pandas and ran and installed them again, but still ran into the same problem.

+7
source share
9 answers

I found a solution, the actual problem is that if any of your recent python scripts generated a .pyc extension file, this error will occur.

the solution is to delete all these files.

-1
source

I encountered the same error and found that I created a file named "random.pyc" by mistake in the same directory as in my PyCharm ayush @ ayush-VirtualBox environment : ~ / PycharmProjects / untitled $ , where "untitled" refers to my project directory. I deleted it, and everything fell into place. Hope this helps!

The reason for this was numpy. It imports another file called Random by default to create its own dependencies, and it took "random.pyc" for me and replaced it.

+3
source

I got this problem on a Rasberry PI and found that the main reason was the missing library:

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

Then it will take several minutes to google the required library source:

 sudo apt-get install libatlas-base-dev 

I have not tested the solution on any other Linux systems, but probably the same method should be applicable. So first try importing the failed library and see what is missing.

+3
source

use "conda install numpy" in the cmd window if you used Anaconda on your computer. I also ran into this problem and I decided to do it. Could this help U.

+1
source

If you use packages options and it contains pandas or some package depends on numpy , you must add the necessary packages to packages .

0
source
 pip uninstall numpy pip install numpy 

It is working

0
source

I had the same error. Fixed with the following:

 python3 -m pip uninstall numpy 

python3 -m pip install numpy==1.14.0

0
source

This error occurs when multiple versions of numpy are installed. Make sure you have only one version of numpy installed. You can create a test file to check this if you do not want to browse directories:

 import numpy print("Numpy imported") 

If you receive a message stating that several versions of numpy are found, you have several versions of numpy installed.

This can be fixed by repeatedly invoking (and not once) pip uninstall numpy until all versions are removed, and then use pip install numpy to get only the latest version.

0
source

try removing pandas and numpy:

pip uninstall pandas pip uninstall numpy

and install them back:

pip install pandas pip install numpy

-2
source

Source: https://habr.com/ru/post/1275039/


All Articles