2

I upgraded from Ubuntu 18.04 to Ubuntu 20.04. Python3.6 disappeared and python3.8 was automatically installed. I am now having trouble using numpy and pandas with python3.8. Attempts to install them are met with a message that they are already installed. However, running python3.8 software that attempts to import them fails with a message that they are not there. I happen to still have a version of python 3.5, which works fine with numpy and pandas. How do I convince python 3.8 that numpy and pandas are really there? I have tried to uninstall numpy and pandas with pip3, thinking that I could fix everything by reinstalling them, but the uninstall command is met with a message that they are not there. I also happen to have a version of python 3.9, and it also has difficulty finding numpy and pandas. There is something strange with my installation of python3.8 and I would like to get it fixed. Any suggestions would be helpful.

  • 1
    Your question should show actual input and output demonstrating the problem. – user535733 Mar 17 '21 at 00:19
  • 1
    Libraries are installed to paths specific to each version of Python - something installed in Python 3.5's path isn't going to be available for 3.8 or 3.9. You'll have to install numpy and pandas for 3.8 and 3.9 separately (e.g., `python3.8 -m pip install numpy pandas` or make a venv for each version and `pip install` in those venvs). – muru Mar 17 '21 at 04:18
  • Remove python packages from /usr/local/... Then you have to use packages from official repositories - python3-numpy, python3-pandas for best success. Please show exact errors in the question body. – N0rbert Mar 17 '21 at 08:03

1 Answers1

1

Looks like you are trying to install with pip3. The problem might be that pip3 is installing for python3.5. I think you want it for python3.8. For installing a library, say numpy with python3.8, do this:

python3.8 -m pip install numpy

or if you want to install it for all your users

sudo python3.8 -m pip install numpy

This should do the trick.

tavish
  • 29
  • 7