简体   繁体   中英

Installation of nltk and scikit-learn

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.

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.

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