numpy is able to be imported in IDLE, but when I try to import it in sublime I get "no module named numpy"

Viewed 30

I have tried force reinstalling numpy, and playing around in terminal. at first, I thought it was my build environment being python 2, so i updated it to python 3 but it is still giving me this error.

1 Answers

To check if both are using the same Python interpreter run this programme in both.

import sys
print(sys.executable)

If the result is different, then that's your issue. You'll need to use the version of pip that's in the same location as the executable to install packages for that executable.

To do this, follow the path returned above and you'll find a subfolder called Scripts, in there is a pip executable. This executable installs packages for its interpreter only, so to install numpy for the interpreter you are using with Sublime, follow the path you got from sublime then use that version of pip to install numpy i.e. in terminal enter:

full/path/to/the/right/pip install numpy
Related