pythonで
from sklearn.cluster import KMeans
というコマンドを実行したところ
Traceback
1 File "xxxx.py", line 14, in <module> 2 from sklearn.cluster import KMeans 3 File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sklearn/__init__.py", line 57, in <module> 4 from .base import clone 5 File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sklearn/base.py", line 11, in <module> 6 from .utils.fixes import signature 7 File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sklearn/utils/__init__.py", line 10, in <module> 8 from .murmurhash import murmurhash3_32 9 File "numpy.pxd", line 155, in init sklearn.utils.murmurhash (sklearn/utils/murmurhash.c:5029) 10ValueError: numpy.dtype has the wrong size, try recompiling 11[Finished in 2.0s with exit code 1]
と出てしまいました。
一応私なりに必要なものはインストールしたつもりなのですが、どこが原因なのでしょうか?
pip listで確認したところ以下の物がインストールされていました。
Benchmarker (4.0.1)
et-xmlfile (1.0.0)
jdcal (1.0)
memory-profiler (0.41)
mysql-connector-python (2.0.4)
numpy (1.11.1)
openpyxl (2.3.0b1)
pandas (0.18.1)
pip (8.1.2)
psutil (4.3.0)
PyMySQL (0.7.6)
python-dateutil (2.5.3)
pytz (2016.6.1)
scikit-learn (0.17.1)
scipy (0.18.0)
setuptools (15.2)
six (1.10.0)
vboxapi (1.0)
xlrd (0.9.4)
またScikit-learnのHP(?)に
Scikit-learn requires:
Python (>= 2.6 or >= 3.3), NumPy (>= 1.6.1), SciPy (>= 0.9).
と書いてあったのですが、scipyのバージョンがあっていませんか?
私自身あっていないと思ったので
pip install -U scipy
と実行したのですが
Requirement already up-to-date: scipy in ./site-packages
Requirement already up-to-date: numpy>=1.7.1 in ./site-packages (from scipy)
とでて最新版っぽいです。
その後にhttp://blog.livedoor.jp/riku_kanzaki/archives/2014-10.html
を参考に
$ sudo easy_install -U numpy
$ pip freeze | grep numpy
numpy==1.9.0
$ pip freeze | grep pandas
pandas==0.14.1
を実行しましたが、何をやっているかもわからず、しかも結果は変わりませんでした。
プログラミング初心者で専門用語などわかりませんが、よろしくお願いします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。