在使用matplotlib的时候,涉及到调用Tkinter包从而产生的error
程序员文章站
2022-04-28 19:28:51
...
如果在使用过程中遇到以下错误:
RuntimeError: tk.h version (8.6) doesn't match libtk.a version (8.5)
我是这样解决的(百度的)
# Tkinter/__init__.py里面检测头文件和库文件版本的几行代码注销掉就行了[一共2个地方]
# if tk_version != _tkinter.TK_VERSION:
# raise RuntimeError("tk.h version (%s) doesn't match libtk.a version (%s)"
# % (_tkinter.TK_VERSION, tk_version))
# Under unknown circumstances, tcl_version gets coerced to float
tcl_version = str(self.tk.getvar('tcl_version'))
# if tcl_version != _tkinter.TCL_VERSION:
# raise RuntimeError("tcl.h version (%s) doesn't match libtcl.a version (%s)" \
# % (_tkinter.TCL_VERSION, tcl_version))