import tkinter产生错误

时间:2011-07-31 13:55:40

标签: python-3.x tkinter turtle-graphics

在Python 3.1上启动Open Book

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

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

您的Python安装不正确,所讨论的库已针对错误的体系结构进行编译,可能是错误的处理器或32位时应该是64或类似的。无论如何,这不是编程错误。