ImportError: No module named 'tkinter' Windows解决办法

Python写线性回归算法,导入了几个科学计算库,运行时报这样的错:

"D:\Program Files\Python 3.5\python.exe" "D:/exercise/AI/testAI/linear regression/ex1_1.py"
Traceback (most recent call last):
  File "D:/exercise/AI/testAI/linear regression/ex1_1.py", line 3, in <module>
    import matplotlib.pyplot as plt
  File "D:\Program Files\Python 3.5\lib\site-packages\matplotlib\pyplot.py", line 115, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "D:\Program Files\Python 3.5\lib\site-packages\matplotlib\backends\__init__.py", line 62, in pylab_setup
    [backend_name], 0)
  File "D:\Program Files\Python 3.5\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 4, in <module>
    from . import tkagg  # Paint image to Tk photo blitter extension.
  File "D:\Program Files\Python 3.5\lib\site-packages\matplotlib\backends\tkagg.py", line 5, in <module>
    from six.moves import tkinter as Tk
  File "D:\Program Files\Python 3.5\lib\site-packages\six.py", line 92, in __get__
    result = self._resolve()
  File "D:\Program Files\Python 3.5\lib\site-packages\six.py", line 115, in _resolve
    return _import_module(self.mod)
  File "D:\Program Files\Python 3.5\lib\site-packages\six.py", line 82, in _import_module
    __import__(name)

ImportError: No module named 'tkinter'


网上折腾了半天,想找到tkinter库,都没找到合适的答案。

然后想是不是Python版本太低了,又下了其他高版本,安装时发现了这一个选项



重新安装一下,然后OK了~

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值