1

first of all - I know there are other people who asked similar questions, but none of the solutions in those posts worked for me.

My problem is that I installed numpy, but for some reason I cannot use it.

I tried several things listed in this post: How to install NumPy for python 3.3.5 on Mac OSX 10.9

In particular I tried

  • -pip install numpy
  • brew install numpy --with-python3
  • downloading numpy on the website and executing the install file in the command line
  • installing anaconda which supposedly comes with numpy

none of this works.. if i open IDLE and type in "import numpy as np" I always get the error message

  Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import numpy as np
ImportError: No module named 'numpy'

I am thinking maybe the problem is that I seem to have 2 python versions installed? In my applications folder, I see that Python 3.5 including IDLE is installed. However, if I type in python --version in the terminal I see that Python 2.7.10 is installed..

can anyone help me to get numpy to work?

Community
  • 1
  • 1
jonasus
  • 231
  • 1
  • 15
  • Your error message does not match itself - did you copy and paste it, or retype it? It shows the command as being `import numpy as np` but the `ImportError` says there is no module named `bumpy`. Are you sure you've been trying to import **n**umpy and not **b**umpy? – MattDMo Mar 06 '16 at 23:48
  • You're right I misspelled it. But before when I typed it in correctly it didn't work either – jonasus Mar 06 '16 at 23:50

1 Answers1

0

I think I did just something that seems to work..

I also have PyCharm installed on my laptop. I just created a new file and typed in "import numpy as np". I told me that it is not installed. So I went to the project interpreter where I found 3 different Python versions (3.5, 2.6 and 2.7).

I selected 2.6, and there I saw numpy in the list of packages. After clicking "apply" I went back to the source code and then there was an option to install the numpy package. Now it seems to work in pycharm as well as in IDLE.

I don't know why this works, but it does. If someone can shed light onto what just happened, and if there is a problem having 3 different python versions - happy to hear your answers!

jonasus
  • 231
  • 1
  • 15