2012-12-11 3 views
0

디스플레이 모듈입니다 :이 (matplotlib) 오류 메시지의 의미는 무엇입니까?

import matplotlib 
matplotlib.use('TkAgg') #TkAgg is quite slow but should work on all platforms. 

import time 
import numpy 
import matplotlib.pyplot as plt 

def display_2d_array(arr): 
    '''Display a square 2D numpy array as a greyscale image.''' 
    assert len(arr.shape) == 2 and arr.shape[0] == arr.shape[1] 
    plt.ion() 
    plt.clf() 
    plt.imshow(arr,origin="lower",extent=[0,arr.shape[0],0,arr.shape[0]]) 
    plt.gray() 
    plt.draw() 
    raw_input('Hit enter to continue.') 

하지만이 모듈을 호출 할 때 내가 얻을 :

File "/Users/tomkimpson/display.py", line 8, in <module> 
import matplotlib.pyplot as plt 
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site     packages/matplotlib/pyplot.py", line 26, in <module> 
from matplotlib.figure import Figure, figaspect 
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/matplotlib/figure.py", line 24, in <module> 
import matplotlib.artist as martist 
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/artist.py", line 7, in <module> 
from transforms import Bbox, IdentityTransform, TransformedBbox, \ 
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/transforms.py", line 35, in <module> 
from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox, 
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/matplotlib/_path.so, 2): no suitable image found. Did find: 
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/matplotlib/_path.so: no matching architecture in universal wrapper 

사람이 무엇을 의미하는지 어떤 생각을?!

+0

기능과 관련이없는 것 같습니다. 오류는 마지막 가져 오기에서 발생합니다. 관련없는 코드를 제거하고보다 유익한 제목을 제공하기 위해 질문을 편집 할 수 있습니다. –

+0

matplotlib 설치에 문제가있는 것 같습니다. 이전에 matplotlib를 성공적으로 사용 했습니까? 아니면이 오류가 무작위로 나타나기 시작 했습니까? matplotlib를 다시 설치해보십시오. – BrenBarn

+0

감사합니다. 다시 설치해 보겠습니다. 전에 matplotlib을 사용하지 마십시오. 프로그래밍 멍청한 짓! – user1887919

답변

0

OS X에서 실행중인 것 같습니다. this question에서 다른 OS X 사용자가 동일한 오류가 발생했습니다. matplotlib 설치가 손상되었을 수 있습니다. 질문에 표시된 대답은 this page에 링크되어 있으며, OS X에 matplotlib을 설치하는 방법을 자세히 설명합니다.

관련 문제