完美解决ImportError: No module named _tkinter的问题(python3.5 下安装python3-tk)

1. 问题描述:运行python文件时出现以下信息
 
[plain]  view plain  copy
在CODE上查看代码片 派生到我的代码片
  1. cryhelyxx@ada:~/python_workspace$ python httpurl.py   
  2. Traceback (most recent call last):  
  3.   File "httpurl.py", line 4, in <module>  
  4.     import Tkinter  
  5.   File "/usr/local/lib/python2.7/lib-tk/Tkinter.py", line 39, in <module>  
  6.     import _tkinter # If this fails your Python may not be configured for Tk  
  7. ImportError: No module named _tkinter  
2. 解决方法:
终端安装python3下的Tkinter:

[html]  view plain  copy
  1. sudo apt-get install python3-tk  

1、换源

2、更新 sudo apt-get update

3、sudo apt-get install python3-tk

4、sudo apt-get install -f


参考链接:https://blog.csdn.net/superrunner_wujin/article/details/65945452

https://blog.csdn.net/qq_18293213/article/details/74483516





评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值