0
我最近遇到了一個關於如何安裝sklearn的博客(http://stronginference.com/ScipySuperpack/)。我成功安裝它,它被存儲在路徑: /usr/local/lib/python2.7/site-packages/sklearn如何在Eclipse上正確安裝sklearn
然後我去了我的eclipse的屬性;在Interpreter-Python下,並將路徑添加到PYTHONPATH中。我可以導入sklearn但是當我跑這簡單的代碼來檢驗一切:
from sklearn import datasets
iris = datasets.load_iris()
digits = datasets.load_digits()
print digits.data
它扔了以下錯誤:
Traceback (most recent call last):
File "/Users/licheng/Documents/workspaceII/SkLearnTutorial/Src/my_first_scilearn.py", line 6, in <module>
from sklearn import datasets
File "/usr/local/lib/python2.7/site-packages/sklearn/datasets/__init__.py", line 7, in <module>
from .base import load_diabetes
File "/usr/local/lib/python2.7/site-packages/sklearn/datasets/base.py", line 24, in <module>
from ..utils import check_random_state
File "/usr/local/lib/python2.7/site-packages/sklearn/utils/__init__.py", line 10, in <module>
from .murmurhash import murmurhash3_32
File "numpy.pxd", line 155, in init sklearn.utils.murmurhash (/private/var/folders/fv/vhs3w0zn2q961_gyp8f2z_rw0000gn/T/pip-EVsI8B-build/sklearn/utils/murmurhash.c:5029)
ValueError: numpy.dtype has the wrong size, try recompiling
什麼可能是錯誤的任何幫助嗎?我已經在這些小時了。
感謝
你的numpy工作正常嗎?它是以32位還是64位編譯的?你是否安裝了32位或64位的scikit-learn? – pyan
@pyan我認爲這是問題所在。我用這個命令重新安裝了它:pip install -U numpy scipy scikit-learn但是會再試一次。 – helpdesk
在這種情況下,您可能需要先卸載。升級可能無法在這裏工作。 – pyan