No module named _tkinter

来源:互联网 发布:ip8823网络广播终端 编辑:程序博客网 时间:2024/06/05 02:47

先运行个yum -y install tcl-devel tk-devel,不知道有没有用
下载了tk和tcl的.tar.gz文件
这样装上它们

  cd unix   ./configure --prefix="/home/123/123"  make   make install 

然后要重装python
这时要编辑python的Modules/Setup.dist文件的tk相关的地方,具体不知道有没有用

主要在~/.bashrc文件加了这个

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/123/123/lib"

make python的时候才不报这些错:
Failed to build these modules: _tkinter
libtk8.*.so: cannot open shared object file: No such file or directory

这个LD_LIBRARY_PATH的设定是根据http://stackoverflow.com/questions/16026348/preparing-tkinter-and-sqlite3-for-python-installation-no-admin-rights

0 0
原创粉丝点击