开发者

import tkinter yields error

Starting the Open Book on Python 3.1

import turtle #this yields an error from importing tkinter

Script:

import tkinter
exi开发者_如何转开发t()

Yields:

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

Any suggestions?


Your Python is incorrectly installed, the library in question has been compiled for the wrong architecture, maybe the wrong processor or for 32 bit when it should have been 64, or similar. In any case this is not a programming error.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜