2011-07-31 79 views
0

關於Python 3.1進口Tkinter的產量錯誤

import turtle #this yields an error from importing tkinter 

腳本啓動開放圖書:

import tkinter 
exit() 

產量:

Traceback (most recent call last): 
    File "imptk.py", line 1, in <module> 
    import tkinter 
    File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/tkinter/__init__.py", line 39, in <module> 
    import _tkinter # If this fails your Python may not be configured for Tk 
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib-dynload/_tkinter.so, 2): no suitable image found. Did find: 
    /Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib-dynload/_tkinter.so: mach-o, but wrong architecture 

有什麼建議?

回答

0

你的Python安裝不正確,有問題的庫已經被編譯爲錯誤的體系結構,可能是錯誤的處理器或32位時它應該是64或類似的。在任何情況下,這都不是編程錯誤。

+0

謝謝。我卸載3.1,安裝3.2.1和ActiveTcl 8.5.10.1,並沒有更多的tkinter錯誤。 – Joel