0

Beginner here, please be gentle! I’m receiving an error that reads

ImportError: No module named sklearn when using pycharm.

I’m trying to import matplotlib, numpy, and sklearn. I’ve downloaded scikit_learn. I’ve also downloaded anaconda.

I have “two” pythons. Looks like this…

  1. MacHD/Library/Frameworks/python.framework/versions/3.4/site-packages/sklearn

  2. MacHD/Library/Python/2.7/ ... in here is pip and scikit_learn

The strange thing is that matplotlib and numpy work but not sklearn. How can I figure out what's wrong?

Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
BabbaBooey
  • 381
  • 1
  • 4
  • 4

1 Answers1

1

The MacHD/Library/Frameworks/python.framework/versions/3.4/site-packages/sklearn is for Python 3.4 (note the 3.4 in the path) and the MacHD/Library/Python/2.7/ is for Python 2.7. The packages for each are independent of each other.

asmeurer
  • 86,894
  • 26
  • 169
  • 240
  • The problem looks like it's between `pycharm` and `anaconda`. The project interpreter in `pycharm` is set to 2.7.10 (/anaconda/bin/python.app), which should be the right one. Import error: No module named sklearn still comes up. The answer on this link is the closest to solving my problem so far (http://stackoverflow.com/questions/18931049/getting-pycharm-to-recognize-anacondas-scipy). I've followed all the instructions except their is no prompt for "prompt you to install setup_tools and pip for that interpreter" – BabbaBooey Sep 15 '15 at 19:44