2011-10-26 54 views
1

我試圖在Mac機上使用matplotlib,我無法用它生成任何迭代圖。在UI顯示上沒有任何情節,我看到以下異常被提出:matplotlib在OS X上的TclError

Exception in Tkinter callback 
Traceback (most recent call last): 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1410, in __call__ 
    return self.func(*args) 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 245, in resize 
    self.show() 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 249, in draw 
    tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2) 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/tkagg.py", line 19, in blit 
    tk.call("PyAggImagePhoto", photoimage, id(aggimage), colormode, id(bbox_array)) 
TclError 

我曾嘗試重新安裝的Tcl/Tk,但結果還是一樣。還有什麼我可以嘗試嗎?每當我嘗試生成一個交互式圖表時,都會發生這種情況,靜態(png)圖片就可以。

+0

Ugh;它並沒有報告Tcl方面的例外情況。 –

+0

我對Tcl沒有經驗。無論如何要知道什麼是Tcl異常?任何日誌? – Raphael

+0

跟蹤將被寫入Tcl全局變量'errorInfo'。 –

回答

1

我有這個問題在Lion和Python 2.7上運行,但我的問題變得非常簡單,或者更好,非常愚蠢;我爲Mac OS 10.3安裝了numpy和matplotlib,所以我在正確的版本10.6上安裝了它們,現在一切正常。順便說一句,官方包可以在其各自的SourceForge頁面找到,

-1

我有同樣的問題,我發現這是因爲混合版本的matplotlib和numpy,我完全刪除它們,並重新安裝它們後,一切都變成好。