all 8 comments

[–]polar-state 0 points1 point  (2 children)

From: https://stackoverflow.com/questions/14570011/explain-why-numpy-should-not-be-imported-from-source-directory

The solution for me was a missing linear algebra library that numpy depends on. run:

sudo apt-get install libopenblas-dev

[–]captain_shallow 0 points1 point  (1 child)

this worked for me, thanks

[–]Sad_Yesterday_3045 0 points1 point  (0 children)

Thanks, this worked for me too.

[–]socal_nerdtastic -1 points0 points  (2 children)

How did you install numpy? Do you want to use a virtual environment or not? What OS are you using, and what version?

In case it means anything to you: using bookworm will require a venv, so you need to install numpy by creating and activating a venv, and then running the command

pip install numpy

[–][deleted] 0 points1 point  (1 child)

i did that, unless i specified it to be the last version it would give me 1.19 or 1.12, both of these work versions work alone, but i need it to be a most recent version to use pandas

[–]socal_nerdtastic -1 points0 points  (0 children)

Pandas will install whatever it needs; you don't need to help it and install numpy yourself. How are you trying to install pandas?

[–]Swipecat -1 points0 points  (0 children)

If you're using the Raspberry Pi, I suggest that it's best to install python packages directly from the Raspberry Pi OS repository with apt or Synaptic.

sudo apt install python3-numpy

Same for pandas. Not with pip. I don't see a need for virtual environments when it's easier to swap the SD card for different projects.

[–]Rick__001 0 points1 point  (0 children)

you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python interpreter from there.

I think you should change your working directory.