Ubuntu安装python3-tk

在测试pytorch的mmdetection时遇到了

ImportError: No module named '_tkinter', please install the python3-tk package

还好参考了这位博主的博客一秒钟解决问题,ok。

参考教程,换了阿里的源,用 sudo vim /etc/apt/sources.list 覆盖了原文件后,执行

$ sudo apt-get update

过程中没出现什么错误,接着执行

$ sudo apt-get install python3-tk

it‘s ok
执行过程

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libpython3.6-minimal linux-headers-4.15.0-29 linux-headers-4.15.0-29-generic linux-image-4.15.0-29-generic linux-modules-4.15.0-29-generic vim-runtime
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  blt tk8.6-blt2.5
Suggested packages:
  blt-demo tix python3-tk-dbg
The following packages will be REMOVED:
  libpython3.6 libpython3.6-stdlib vim
The following NEW packages will be installed:
  blt python3-tk tk8.6-blt2.5
0 upgraded, 3 newly installed, 3 to remove and 52 not upgraded.
Need to get 604 kB of archives.
After this operation, 13.5 MB disk space will be freed.
Do you want to continue? [Y/n]

转载博主 https://blog.csdn.net/dstjwjw/article/details/83449931

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值