0

After looking at this question, this question and this question I am still unable to import numpy into python, either inside a shell or directly in PyCharm.

I have uploaded a screenshot for context and am willing to upload any other results that might help resolve this issue. What am I doing wrong?

enter image description here

  • How many Python installations do you have now on your system? Are you sure the one you are running is the same pip is pointed to? – jaboja Jul 06 '18 at 22:16
  • @jaboja It is definitely possible that I have 2 or 3 installations; is there an easy way to check which one pip is pointed to, or should I try to find and delete all of them then reinstall? –  Jul 06 '18 at 22:21
  • @jaboja I found a total of four copies of python; how can I tell which one pip is pointed at? –  Jul 06 '18 at 22:31
  • `where.exe` command may be helpful – jaboja Jul 07 '18 at 23:24

1 Answers1

0

Try this

python -m pip install numpy

This will make sure you install numpy for the same python version which is invoked when you call python on the terminal.

lakshayg
  • 2,053
  • 2
  • 20
  • 34
  • Beautiful! Thank you very much. –  Jul 06 '18 at 22:39
  • Any chance there's a simple solution like this for working inside pycharm? It still can't find numpy in there. –  Jul 06 '18 at 22:42
  • PyCharm lets you choose the python interpreter you want to use for the project. Just install numpy for the interpreter configured for your project. OR you could also try working with a virtualenv – lakshayg Jul 06 '18 at 22:45
  • I'm very new to programming and picking up a project that a friend left off; is there any way to tell which python interpreter is configured for the project? –  Jul 06 '18 at 22:48
  • In the pycharm sidebar, you should see a tiny arrow next to "external dependencies", clicking there should show you the location of the python interpreter your project is using. – lakshayg Jul 06 '18 at 22:55
  • Here is a picture of what I see there http://tinypic.com/r/zloffq/9, I'm not quite sure how to parse it. Is there some way to point the command prompt at this python installation and put numpy in there? –  Jul 06 '18 at 23:01
  • Your python interpreter is present in `C:\Users\alecj\PycharmProjects\test\venv\Scripts\python.exe`. It appears to me that you are already using a virtualenv. See this page for instructions on how to install a package using PyCharm: https://www.jetbrains.com/help/pycharm-edu/installing-uninstalling-and-upgrading-packages.html#install_package – lakshayg Jul 06 '18 at 23:07
  • Thank you, I'll look over there and try to figure it out. –  Jul 06 '18 at 23:11