我试图在我的 Linux Mint 12 上安装 scikit-learn 但失败了。我从http://pypi.python.org/pypi/scikit-learn/下载了这个包并安装了
sudo python2.7 setup.py install
然后我将目录更改为 home 并启动 python2.7 shell。在导入 sklearn 时,我得到:
>>> import sklearn
/usr/lib/python2.7/dist-packages/scipy/spatial/__init__.py:7: RuntimeWarning:
numpy.dtype size changed, may indicate binary incompatibility
from ckdtree import *
/usr/lib/python2.7/dist-packages/scipy/spatial/__init__.py:7: RuntimeWarning:
numpy.ndarray size changed, may indicate binary incompatibility
from ckdtree import *
/usr/lib/python2.7/dist-packages/scipy/spatial/__init__.py:7: RuntimeWarning:
numpy.ufunc size changed, may indicate binary incompatibility
from ckdtree import *
/usr/lib/python2.7/dist-packages/scipy/spatial/__init__.py:8: RuntimeWarning:
numpy.dtype size changed, may indicate binary incompatibility
from qhull import *
/usr/lib/python2.7/dist-packages/scipy/spatial/__init__.py:8: RuntimeWarning:
numpy.ndarray size changed, may indicate binary incompatibility
from qhull import *
/usr/lib/python2.7/dist-packages/scipy/spatial/__init__.py:8: RuntimeWarning:
numpy.ufunc size changed, may indicate binary incompatibility
from qhull import *
我认为问题出在 scipy 的空间上。这是因为当我这样做时
>>> from scipy import spatial
我得到了与 Scikit-learn 相同的错误。
请帮忙。谢谢你。
编辑:新错误。
>>> import sklearn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/scikit_learn-0.12_git-py2.7-linux-
x86_64.egg/sklearn/__init__.py", line 17, in <module>
from .base import clone
File "/usr/local/lib/python2.7/dist-packages/scikit_learn-0.12_git-py2.7-linux-
x86_64.egg/sklearn/base.py", line 11, in <module>
from .metrics import r2_score
File "/usr/local/lib/python2.7/dist-packages/scikit_learn-0.12_git-py2.7-linux-
x86_64.egg/sklearn/metrics/__init__.py", line 6, in <module>
from .metrics import confusion_matrix, roc_curve, auc, precision_score, \
File "/usr/local/lib/python2.7/dist-packages/scikit_learn-0.12_git-py2.7-linux-
x86_64.egg/sklearn/metrics/metrics.py", line 17, in <module>
from ..utils import check_arrays
File "/usr/local/lib/python2.7/dist-packages/scikit_learn-0.12_git-py2.7-linux-
x86_64.egg/sklearn/utils/__init__.py", line 9, in <module>
from .murmurhash import murmurhash3_32
File "numpy.pxd", line 174, in init sklearn.utils.murmurhash (sklearn/utils
/murmurhash.c:4776)
ValueError: numpy.ndarray has the wrong size, try recompiling