Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pandas Missing required dependencies ['numpy']

enter image description here

I am currently following a beginners introduction to machine learning. While entering in the command: import pandas as pd in the python shell in terminal, I get an error reading:

ImportError: Missing required dependencies ['numpy'].

I already looked at the other similar question, tried that solution, but still received the same error.

like image 420
sdksmkfnajnf Avatar asked Feb 17 '26 12:02

sdksmkfnajnf


2 Answers

Looks like you might be running on a Mac and perhaps using the default system python. For whatever reason you don't have a complete installation. you have pandas but not numpy. I'm not sure which packages the tutorial you are following uses, but I would recommend installing the Anaconda python distribution as it includes pandas, all its dependencies and much more, including the scikit-learn package often used for machine learning.

If you want to know more about installing a Python environment for machine learning on a Mac, there is a good tutorial on machinelearningmastery.com.

like image 200
Peter van Heusden Avatar answered Feb 20 '26 02:02

Peter van Heusden


This doesn't have anything to do with incompatibility. As @Peter mentioned, you simply don't have NumPy and should install through Anaconda. Here is the code within pandas that is giving you the error:

# Let users know if they're missing any of our hard dependencies
hard_dependencies = ("numpy", "pytz", "dateutil")
missing_dependencies = []

for dependency in hard_dependencies:
    try:
        __import__(dependency)
    except ImportError as e:
        missing_dependencies.append(dependency)

if missing_dependencies:
    raise ImportError("Missing required dependencies {0}".format(missing_dependencies))
del hard_dependencies, dependency, missing_dependencies

Notice there is nothing here about version.

like image 24
Brad Solomon Avatar answered Feb 20 '26 02:02

Brad Solomon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!