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
사람이 무엇을 의미하는지 어떤 생각을?!
기능과 관련이없는 것 같습니다. 오류는 마지막 가져 오기에서 발생합니다. 관련없는 코드를 제거하고보다 유익한 제목을 제공하기 위해 질문을 편집 할 수 있습니다. –
matplotlib 설치에 문제가있는 것 같습니다. 이전에 matplotlib를 성공적으로 사용 했습니까? 아니면이 오류가 무작위로 나타나기 시작 했습니까? matplotlib를 다시 설치해보십시오. – BrenBarn
감사합니다. 다시 설치해 보겠습니다. 전에 matplotlib을 사용하지 마십시오. 프로그래밍 멍청한 짓! – user1887919