'trouble installing numpy for python3.9

I am running on ubuntu with several python versions installed. What am I missing?

user@serverA:/folderB$ python3.9 -m pip install numpy
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (1.13.3)
user@serverA:/folderB$ python3.9 logs_unifier.py 
Traceback (most recent call last):
  File "/folderB/logs_unifier.py", line 2, in <module>
    import pandas as pd
  File "/usr/lib/python3/dist-packages/pandas/__init__.py", line 18, in <module>
    raise ImportError(
ImportError: Missing required dependencies ['numpy']
user@serverA:/folderB$ 


Solution 1:[1]

Try running python3.9 -m pip install -U --user numpy. -U means upgrade, and --user means it'll install in your user folder, not the system folder - it just gets rid of that message.

NumPy is up to version 1.22, so it's possible that pandas just doesn't work with the old version.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1