0
votes

I have been trying to install and use scikit-learn and nltk. However, I get the following error while importing anything:

Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/site-packages/sklearn/init.py", line 57, in from .base import clone File "/usr/local/lib/python2.7/site-packages/sklearn/base.py", line 11, in from .utils.fixes import signature File "/usr/local/lib/python2.7/site-packages/sklearn/utils/init.py", line 10, in from .murmurhash import murmurhash3_32 File "numpy.pxd", line 155, in init sklearn.utils.murmurhash (sklearn/utils/murmurhash.c:5029) ValueError: numpy.dtype has the wrong size, try recompiling

I did a pip uninstall numpy followed by a pip install numpy and also a pip uninstall scikit-learn and again reinstalled it. But the error persists.

1
try easy_install --upgrade numpy. Then you can install scikit-learn by using pip.Guiem Bosch

1 Answers

1
votes

I met the same problem today. Now I have solved it. Because I have installed numPy manually, and I use the command "pip" to install the else package. Solve way:

  1. find the old version of numPy. You can import numPy and print the path of it.
  2. delete the folder.
  3. use pip to install again.