1

I'm on Ubuntu 12.04. I've installed the numpy and scipy packages with the following command:

sudo apt-get install python-numpy python-scipy python-matplotlib

When I run this command now, it says that the latest versions are already installed.

However, when I go into python in the command prompt and ask it to "import numpy", it says no such module is installed. It's the same for scipy and matplotlib. What's going on?

5
  • 1
    Have you installed a version of python by some means other than apt-get? In a terminal what does which python print? Apr 1, 2014 at 19:49
  • Looks like python2 packages and python3 interpreter. Try import numpy in both python2 and python3. Apr 1, 2014 at 19:49
  • I've tried it in both... it doesn't seem to work. which python returns /usr/local/bin/python. I remember trying to install python a different way - don't recall how - back when I first got ubuntu setup. Then I learned that python was pre-installed on ubuntu. Maybe I have two python2.7's installed because of that? Apr 1, 2014 at 20:10
  • 1
    Try /usr/bin/python2 -c 'import numpy; print numpy.__version__' to test if the Ubuntu-provided python can see numpy. It seems like your /usr/local/.. version is getting in the way.
    – Rory Yorke
    Apr 2, 2014 at 12:14
  • 2
    It can see it from there! So when running python, I need to type in the full address /usr/bin/python2? Is there a way I can change the "default" python? Apr 3, 2014 at 18:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.