如何在Windows 10,python 3.6.1上安装tkinter

时间:2017-06-05 11:03:16

标签: python tkinter

我在使用matplotlib和pymc3等几个不同的软件包时遇到过类似的错误,错误信息说:

    Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python36\lib\site-packages\matplotlib\pyplot.py", line 115, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "C:\Python36\lib\site-packages\matplotlib\backends\__init__.py", line 32, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "C:\Python36\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 6, in <module>
    from six.moves import tkinter as Tk
  File "C:\Python36\lib\site-packages\six.py", line 92, in __get__
    result = self._resolve()
  File "C:\Python36\lib\site-packages\six.py", line 115, in _resolve
    return _import_module(self.mod)
  File "C:\Python36\lib\site-packages\six.py", line 82, in _import_module
    __import__(name)
ModuleNotFoundError: No module named 'tkinter'

我对python完全不熟悉,不知道tkinter是什么。在一些谷歌之后,我尝试将ActiveTcl 8.6.4安装到默认路径中,但它不起作用。

我该怎么办?

1 个答案:

答案 0 :(得分:1)

最后,我弄明白发生了什么。我在安装之前取消选中tcl / tk选项,这可能是问题所在。我刚刚修改了我的python安装,希望它可以提供帮助。