Python Tkinter不工作mac osx el capitan
我试图使用Python2.7导入MAC OSX el capitan版本10.11中的模块Tkinter,但出现以下错误:Python Tkinter不工作mac osx el capitan,python,python-2.7,tkinter,python-2.x,osx-elcapitan,Python,Python 2.7,Tkinter,Python 2.x,Osx Elcapitan,我试图使用Python2.7导入MAC OSX el capitan版本10.11中的模块Tkinter,但出现以下错误: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", l
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 39, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py”,中第39行
导入_tkinter#如果失败,您的Python可能无法配置为Tk
ImportError:没有名为\u tkinter的模块
我想为这个问题找到一个解决方案,因为这似乎是一个安装问题,网页ActiveTCL似乎被破坏了可能是来自Python 3的副本,操作系统是Ubuntu Linux可能的答案是这些解决方案是针对Ubuntu的,我正在寻找MAC EL CAPITANI遇到的相同问题。看起来El Capitan中的系统python2.7没有安装tkinter。使用自制版本的python3时效果很好。可能是python3的副本,操作系统是Ubuntu Linux。可能的答案是这些解决方案是针对Ubuntu的,我正在寻找MAC EL CAPITANI遇到同样的问题。看起来El Capitan中的系统python2.7没有安装tkinter。使用自制版本的python3时工作正常。