Failed to import 'numpy' module

You sir just save the day.

I have the same problem, how can I solve it? , I have python3 and the instructions are for python2.

@cofhal yes. After running Hundsbuah fix, it correct the issue I was having with numpy not running in Python3. Just follow Hundsbuah’s instruction in upgrading the system components to install Python2.

See Numpy won't install on pi3b Klipper

Why doesn’t numpy work with python 3?

I solved the problem with ~/klippy-env/bin/pip install -v numpy==1.25.2, but now I get this error: Internal error on command:“TEST_RESONANCES”

Open a new post and follow the template.

I was able to fix the issue with

sudo apt install libopenblas-base

I found out about it by running (as user pi, the same user that KIAUH runs as) ~/klippy-env/bin/python and typing import numpy. A large stacktrace appeared with an error message about libopenblas.so.0 not being found.

12 Likes

Thanks mate, this one fixed my problem.

Cheers,
Stefan

AndreKR’s fix almost fixed for me except instead of:
sudo apt install libopenblas-base which gave me this error "E: Unable to locate package libopenblas-base
"
I did this:

sudo apt-get install libopenblas-dev

which fixed the problem.

This clue was in line with AndreKR’s " ~/klippy-env/bin/python and typing import numpy ."

Thanks AndreKR and Stuffi!

2 Likes

Thanks AndreKR, your suggestion worked for me. I only wish I had found it before I pulled all of my hair out.

Came here because I had the same issue, this install fixed it! Thanks @AndreKR!

I know this is a old thread, but I have just tried using the KUSBA accelerometer and I was getting the same error message with regards to numpty. Tired your suggestion and it did the trick. So thank you very much

Thank you very much!

Installing the dev package is probably not required for python.

libobenblas-base should be enough.

thanks brother!

THANK YOU! This fix the issue with the [Failed to import numpy module]

Solved my the error I had, thank you!

Signed up just to say THANK YOU. This worked for me too

Thanks AndreKR & oldab
Installed sudo apt-get install libopenblas-base
Fixed the error [Failed to import numpy module]
Works perfect now.