简体   繁体   中英

ImportError SciKit-learn

I am trying to get started with machine learning, so I have installed the packages: numpy, Scikit-learn, matplotlib, scipy . Some I have installed directly from pip with:

python -m pip install "package name"

and and others i have downloaded the binary files and then installed with pip . It shows no errors when I import matplotlib, numpy and sklearn , but when I write:

from sklearn import svm

it gives me the error:

ImportError: cannot import name 'svm'  

I am on Python 3.5.1 and on Windows 10. Does anyone have any solutions?

import sklearn.svm as svm

model = svm.SVC()
....

http://scikit-learn.org/stable/modules/classes.html#module-sklearn.svm

It does seem that you didn't install it properly. Since you're on windows I would recommend using the Unofficial Windows Binaries for Python Extension Packages website to install future packages.

Make sure you also install the proper binaries as I pointed out in this post Installing scipy in Python 3.5 on 32-bit Windows 7 Machine . The windows version doesn't matter just make sure you're downloading Visual C++ 2015 redistributable package.

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