简体   繁体   中英

how to solve error module sklearn.cluster?

i want to make recommendation location but i have problem with my sklearn. i have been update my library but it is not work. i use python 2.7 with anaconda

在此处输入图片说明

please help me :D it is my library code.

from sklearn.cluster import KMeans
import numpy as np
import pandas as pd
from sklearn.cross_validation import train_test_split
from sklearn.metrics import accuracy_score, recall_score, precision_score
from sklearn import svm
from numpy import algorithms, environment
import plotly
import plotly.plotly as py
import plotly.graph_objs as go

Windows

  • Open command prompt(as admin)
  • enter 'pip install -U scikit-learn'

Unix

  • Open terminal
  • Enter 'sudo pip install -U scikit-learn'

The default Anaconda distribution should have all of these packages, so it's likely your interpreter is looking for packages in a different spot. This is controlled by the PYTHONPATH system variable, which tell it where to look for package imports.

Anaconda can set this correctly for you during (re)installation if you choose to update the variable. You can also edit it yourself--how you do so depends on your OS.

To view the variable in python for troubleshooting: How do I find out my python path using python? This should point to a directory on you computer containing the package files.

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