问题:
跑MASK RCNN代码出错 https://github.com/CharlesShang/FastMaskRCNN
python download_and_convert_data.py
错误提示:
If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter
环境:
Ubuntu: 16.04
pyenv + virutalenv+Python: 3.6.5
尝试解决过程:
1. 安装包,依然报错
sudo apt install python3-tk
2. 安装开发包,依然报错
sudo apt install tk-dev
3. 下载源码,安装,依然报错
源码地址 http://www.tcl.tk/software/tcltk/download.html
wget https://prdownloads.sourceforge.net/tcl/tcl8.6.9-src.tar.gz
wget https://prdownloads.sourceforge.net/tcl/tk8.6.9.1-src.tar.gz
# 安装tk
gunzip < tk8.6.9.1-src.tar.gz | tar xvf -
cd tk8.6.9.1/unix
./configure
make
sudo make install
# 安装tcl
gunzip < tcl8.6.9-src.tar.gz | tar xvf -
cd tcl8.6.9/unix
./configure
make
sudo make install
#查看版本
wish
info tclversion
puts $tk_version
4. 重新编译python之后,成功!
pyenv install -v 3.6.5 #-v 是version,指定版本
其实可能只需最后一步。
参考:
https://blog.csdn.net/superrunner_wujin/article/details/65945452
https://blog.csdn.net/weixin_33693070/article/details/87211282
https://blog.csdn.net/blueheart20/article/details/78763208