简体   繁体   中英

Cannot import scikit-learn

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM