0

I have installed sklearn and its related packages with this pip3 install command, and in the iTerm I can sucessfully use import sklearn. But when I tried to import sklearn in sublime text3, it will give me this error ModuleNotFoundError: No module named 'sklearn', the same thing also happens when I try to import numpy or scipy, does anybody know why is this happening?

Jeremy
  • 91
  • 3
  • 12
  • You have multiple versions of python on your machine and Sublime Text is pointing to the python version that does not have those packages installed. Reconfigure Sublime Text to point to your python3 version. – Abdou Jul 02 '17 at 10:10
  • I have only used the 3.6.1 version of python, so I have installed all these packages in my ```/usr/local/lib/python3.6/site-packages```. Before today, I can always correctly import them in sublime text, so I really don't understand why are these packages different from others. – Jeremy Jul 02 '17 at 10:39
  • Since you're using a mac, I am certain that there is a python2 version already installed. It comes with the OS. You have to configure your build system in Sublime if you wish to use your python3 version. [This link here](https://stackoverflow.com/questions/23257984/python3-4-on-sublime-text-3) should help. – Abdou Jul 02 '17 at 10:46
  • It worked, although I didn't really get the reason why this didn't happen before. Anyway, thanks a lot! – Jeremy Jul 02 '17 at 11:05

0 Answers0