centos7上安装tkinter

发布时间 2023-11-20 16:59:15作者: bbzhang

报错:You must install tkinter on Linux to use MouseInfo. Run the following: sudo apt-get install python3-dev

1 # yum install -y tk tk-devel tcl tcl-devel
2 重新编译Python
$ ./configure --with-tcltk-includes='-I /usr/local/include'       --with-tcltk-libs='/usr/local/lib/libtcl8.6.so /usr/local/lib/libtk8.6.so'
(根据你tcl和tk安装的位置调整include和lib目录的位置,可以在/usr下,find -name "libtk*"查看位置)
$ make
$ sudo make install