RuntimeError: module compilé avec la version de l'API 0xc, mais cette version de numpy est 0xb

J'essaie d'apprendre à l'Apprentissage de la Machine, mais je ne peut pas résoudre d'erreur ci-dessous.

[Mon environnement]

  • Mac High Sierra 10.13.2
  • Python3.4.5
  • Numpy1.13.3

[Commande]

$ python3 -c "import jupyter, matplotlib, numpy, pandas, scipy, sklearn"

[Erreur]

RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb
Traceback (most recent call last):
  File "/Users/uekyo/ml/env/lib/python3.4/site-packages/pandas/__init__.py", line 26, in <module>
    from pandas._libs import (hashtable as _hashtable,
  File "/Users/uekyo/ml/env/lib/python3.4/site-packages/pandas/_libs/__init__.py", line 4, in <module>
    from .tslib import iNaT, NaT, Timestamp, Timedelta, OutOfBoundsDatetime
  File "pandas/_libs/tslib.pyx", line 1, in init pandas._libs.tslib
ImportError: numpy.core.multiarray failed to import

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/uekyo/ml/env/lib/python3.4/site-packages/pandas/__init__.py", line 35, in <module>
    "the C extensions first.".format(module))
ImportError: C extension: numpy.core.multiarray failed to import not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.

[Choses que j'ai essayé]

J'ai compris numpy est faux. J'ai donc essayé les choses ci-dessous, mais l'erreur s'affiche toujours.

~1~

sudo mv /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy_old

~2~

pip3 uninstall numpy
pip3 install numpy  -I

Grâce.

1) le Déplacement de la Python2 installation de NumPy ne fera rien, comme vos commandes sont toutes Python3. 2) L'erreur se produit lors de l'importation de pandas, alors essayez de réinstaller que, trop.
Merci pour vos conseils, Mais a échoué à nouveau. L'erreur est la même.
J'ai trouvé que la commande est OK. <br/> python3 -c "import jupyter, matplotlib, numpy, scipy, sklearn
jupyter==1.0.0 matplotlib==2.0.2 numexpr==2.6.3 numpy==1.13.1 pandas==0.20.3 Oreiller==4.2.1 protobuf==3.4.0 psutil==5.3.1 scikit-learn==0.19.0 scipy==0.19.1 sympy==1.1.1 tensorflow==1.3.0
Merci bnaecker. Votre pandas suggestion me conduire à la solution.

OriginalL'auteur uekyo | 2018-01-02