2017-06-16 7 views
1

Jeder hat das gleiche Problem, das ich für das Ausführen von Pytest mit folgendem Fehler haben. Die Art, wie ich die Umgebung zu installieren ist herunterladen Python aus https://www.python.org/downloads/ und PKG-Datei erstellen req.file installieren und Paket installieren, indem so req.filepytest 3.0.7 Fehler beim Import Pandas 2.20.1

os: x el capitan 
python:3.6.1 
pytest:3.0.7 
pandas:2.20.2 

req.file 
psutil==4.0.0 
pandas==0.20.2 
numpy==1.10.4 
py==1.4.31 
pytest==3.0.7 
pytest-cov==2.2.1 
pytest-mock==0.10.1 

script.py 
import pandas as pd 


/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/__init__.py:31: in <module> 
    "extensions first.".format(module)) 
E ImportError: C extension: umpy.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' to build the C extensions first. 
-------------------------------------------------------------------------------- Captured stderr --------------------------------------------------------------------------------- 
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa 

Antwort

0

installieren -r pip, was ich versucht habe, wird unter Verwendung von virtuellen env einstellen up-Python-Projekt und installieren Sie alle Pakete neu, um sicherzustellen, dass die Projektumgebung auf meine lokale Umgebung isoliert ist. also richte virtuelles env ein und dann kein Problem mehr Pandas zu installieren

$pip3 install virtualenv 
$virtualenv --python=/usr/bin/python3.6 <path/to/new/project/>