2016-06-28 7 views
1

Ich habe Probleme beim Importieren von Numpy."ImportError: Name kann SkipTest nicht importieren" beim Importieren von Numpy in Python

Bitte fin unter Versionsinformationen:

# cat /etc/redhat-release 
CentOS release 6.5 (Final) 

# python -V 
Python 2.6.6 

Ich habe bereits installiert numpy (neu installiert mehrmals) pip verwenden.

# pip install numpy 

aber wenn ich versuche, numpy zu importieren, zeigt es Fehler wie folgt:

# python 
Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> 
>>> import numpy 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "/usr/lib64/python2.6/site-packages/numpy/__init__.py", line 180, in <module> 
    from . import add_newdocs 
    File "/usr/lib64/python2.6/site-packages/numpy/add_newdocs.py", line 13, in <module> 
    from numpy.lib import add_newdoc 
    File "/usr/lib64/python2.6/site-packages/numpy/lib/__init__.py", line 8, in <module> 
    from .type_check import * 
    File "/usr/lib64/python2.6/site-packages/numpy/lib/type_check.py", line 11, in <module> 
    import numpy.core.numeric as _nx 
    File "/usr/lib64/python2.6/site-packages/numpy/core/__init__.py", line 58, in <module> 
    from numpy.testing.nosetester import _numpy_tester 
    File "/usr/lib64/python2.6/site-packages/numpy/testing/__init__.py", line 12, in <module> 
    from . import decorators as dec 
    File "/usr/lib64/python2.6/site-packages/numpy/testing/decorators.py", line 21, in <module> 
    from .utils import SkipTest 
ImportError: cannot import name SkipTest 
>>> 

ich sogar versucht haben, "yum installieren Python". In allen Fällen (numpy und python selbst) wurde die Installation erfolgreich abgeschlossen. Aber immer noch denselben Fehler wie oben "ImportError: Name SkipTest kann nicht importiert werden".

Jede Lösung der Problemumgehung wird sehr geschätzt.

Danke, Obaid

Antwort

1

Tat neuere numpies nicht mehr unterstützt Python 2.6

0

Scheint, wie ich meine Python-Version aktualisieren. In der Tat, nach der Installation von Python2.7 ist alles glatt.

Ich habe installiert python2.7 von numpy gefolgt wie folgt:

yum install python27 
scl enable python27 bash 
pip2.7 install numpy 

Dann python2.7 cli mit importieren numpy ich konnte.

Danke, Obaid

Verwandte Themen