导入 tkinter 产生错误
开始关于 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
有什么建议吗?
Starting the Open Book on Python 3.1
import turtle #this yields an error from importing tkinter
Script:
import tkinter
exit()
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的Python安装不正确,有问题的库是为错误的架构编译的,可能是错误的处理器,或者是32位,而它应该是64位,或类似的。无论如何,这都不是编程错误。
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.