• python的tkinter版本不匹配问题:RuntimeError: test:tk.h version (8.4) doesn't match libtk.a version (8.5)


    Traceback (most recent call last):
    File "/root/CodeWorkPace/test/TCPClient.py", line 20, in <module>
    plt.pie(sizes,explode=explode,labels=labels,colors=colors,autopct='%1.1f%%',shadow=True,startangle=50)
    File "/opt/python3/lib/python3.4/site-packages/matplotlib/pyplot.py", line 3280, in pie
    ax = gca()
    File "/opt/python3/lib/python3.4/site-packages/matplotlib/pyplot.py", line 949, in gca
    return gcf().gca(**kwargs)
    File "/opt/python3/lib/python3.4/site-packages/matplotlib/pyplot.py", line 586, in gcf
    return figure()
    File "/opt/python3/lib/python3.4/site-packages/matplotlib/pyplot.py", line 535, in figure
    **kwargs)
    File "/opt/python3/lib/python3.4/site-packages/matplotlib/backends/backend_tkagg.py", line 81, in new_figure_manager
    return new_figure_manager_given_figure(num, figure)
    File "/opt/python3/lib/python3.4/site-packages/matplotlib/backends/backend_tkagg.py", line 89, in new_figure_manager_given_figure
    window = Tk.Tk()
    File "/opt/python3/lib/python3.4/tkinter/__init__.py", line 1807, in __init__
    self._loadtk()
    File "/opt/python3/lib/python3.4/tkinter/__init__.py", line 1822, in _loadtk
    % (_tkinter.TK_VERSION, tk_version))
    RuntimeError: test:tk.h version (8.4) doesn't match libtk.a version (8.5)

    搞了好多天,为了解决版本不匹配的问题,网上也没给明确的解决方案,所以直接把版本判断的语句注释掉了,也就能用了,如图:

    改为:

    这个文件在python的安装包下的 /lib/python3.4/tkinter/__init__.py  文件当中

    无赖的报错解决了~·

     

  • 相关阅读:
    pytest.4.Fixture
    pytest.3.Assert
    pytest.2.运行多个文件
    [LeetCode 378.] Kth Smallest Element in a Sorted Matrix
    priority_queue 自定义 comparator
    原地调整法查找数组元素
    [LeetCode 436.] Find Right Interval
    [LeetCode 611.] Valid Triangle Number
    二叉树Morris遍历
    用户态IO:DPDK
  • 原文地址:https://www.cnblogs.com/tjc1996/p/6414552.html
Copyright © 2020-2023  润新知