Sklearn "numpy.dtype is the wrong size, try recompiling" in both pycharm and terminal

I got "numpy.dtype is the wrong size, try recompiling" both in pycharm and in the terminal when compiling the Sci-kit training. I updated all packages (numpy, scikit to the latest), nothing works. The version for Python is 2.7. Please help. Appreciate!

    checking for nltk
    Traceback (most recent call last):
    File "startup.py", line 6, in <module>
    import nltk
      File "/Library/Python/2.7/site-packages/nltk/__init__.py", line 128, in <module>
      from nltk.chunk import *
      File "/Library/Python/2.7/site-packages/nltk/chunk/__init__.py", line 157, in <module>
   from nltk.chunk.api import ChunkParserI
  File "/Library/Python/2.7/site-packages/nltk/chunk/api.py", line 13, in <module>
    from nltk.parse import ParserI
  File "/Library/Python/2.7/site-packages/nltk/parse/__init__.py", line 79, in <module>
    from nltk.parse.transitionparser import TransitionParser
  File "/Library/Python/2.7/site-packages/nltk/parse/transitionparser.py", line 21, in <module>
    from sklearn.datasets import load_svmlight_file
  File "/Library/Python/2.7/site-packages/sklearn/__init__.py", line 57, in <module>
    from .base import clone
  File "/Library/Python/2.7/site-packages/sklearn/base.py", line 11, in <module>
    from .utils.fixes import signature
  File "/Library/Python/2.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 (sklearn/utils/murmurhash.c:5029)
ValueError: numpy.dtype has the wrong size, try recompiling
+3
source share
2 answers

"numpy.dtype , " , sklearn numpy, , numpy, sklearn. , , sklearn numpy, , . . ValueError: numpy.dtype , .

, , OSX Python (, OSX, /usr/bin/python). Apple Python , numpy, , pip .. - . https://github.com/MacPython/wiki/wiki/Which-Python#system-python-and-extra-python-packages. Python.org homebrew Python, numpy.

+1

, . , :

pip freeze

,

pip freeze | grep Module_Name

, :

pip install -U scikit-learn numpy scipy pandas matplotlib

(30/11/2016). :

matplotlib==1.5.2
nltk==3.2.1
numpy==1.11.2
pandas==0.19.1
scikit-learn==0.18.1
scipy==0.18.1
textblob==0.11.1
0

Source: https://habr.com/ru/post/1652733/


All Articles