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  文件当中

 

无赖的报错解决了~·

 

posted on 2017-02-18 23:51  野区杰西  阅读(1136)  评论(1编辑  收藏  举报

导航