1. 问题描述:运行python文件时出现以下信息
- cryhelyxx@ada:~/python_workspace$ python httpurl.py
- Traceback (most recent call last):
- File "httpurl.py", line 4, in <module>
- import Tkinter
- File "/usr/local/lib/python2.7/lib-tk/Tkinter.py", line 39, in <module>
- import _tkinter # If this fails your Python may not be configured for Tk
- ImportError: No module named _tkinter
2. 解决方法:
终端安装python3下的Tkinter:
- 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