一、问题描述
Windows下使用python中的tkinter时出现的一个奇怪的问题,之前写的代码明明没有问题,更新python版本之后,结果再使用tkinter时报错:“Tcl lnit error: Can’t find a usable init.tcl in the following directories”
当前的系统和python版本:
- 操作系统:win10
- python版本:3.10
二、解决方案
原因:系统查找的库目录不对,默认查找D:\Programs\python310\Lib,其中,D:\Programs\python310是你的Python安装路径
方法:将D:\Programs\python310\tcl下的tcl8.6文件夹复制拷贝到D:\Programs\python310\Lib文件夹中