Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if vscode cannot load tkinter?

2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces vscode can not load tkinter how to do, the article is very detailed, has a certain reference value, interested friends must read it!

After learning Python to configure VScode, I encountered some problems after installing easygui.

The code is as follows:

Import easyguieasygui.msgbox ("Hello world.")

Ctrl+Shift+B, the error is reported as follows:

Traceback (most recent call last): File "/ usr/lib/python3.5/tkinter/__init__.py", line 36, in import _ tkinterImportError: No module named'_ tkinter'During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/ home/hongludianxue/.local/lib/python3.5/site-packages/easygui/boxes/utils.py", line 29, in import tkinter as tk # python3 File "/ usr/lib/python3.5/tkinter/__init__.py" Line 38, in raise ImportError (str (msg) +', please install the python3-tk package') ImportError: No module named'_ tkinter', please install the python3-tk packageDuring handling of the above exception, another exception occurred:Traceback (most recent call last): File "/ home/hongludianxue/.local/lib/python3.5/site-packages/easygui/boxes/utils.py", line 36, in import Tkinter as tk # python2ImportError: No module named 'Tkinter'During handling of the above exception Another exception occurred:Traceback (most recent call last): File "/ home/hongludianxue/.local/lib/python3.5/site-packages/easygui/boxes/button_box.py", line 15, in from. Import utils as ut File "/ home/hongludianxue/.local/lib/python3.5/site-packages/easygui/boxes/utils.py", line 43, in raise ImportError ("Unable to find tkinter package.") ImportError: Unable to find tkinter package.During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/ home/hongludianxue/Documents/Python file/0x00.py", line 1 In import easygui File "/ home/hongludianxue/.local/lib/python3.5/site-packages/easygui/__init__.py", line 34, in from .boxes.button _ box import buttonbox File "/ home/hongludianxue/.local/lib/python3.5/site-packages/easygui/boxes/button_box.py", line 18, in import global_stateImportError: No module named 'global_state'

I didn't know until I saw ImportError: No module named'_ tkinter' that there was no tkinter module.

Install tkinter in the terminal:

Sudo apt-get install python3-tk

After running the Python code before it is finished, it is found that it has been run successfully.

These are all the contents of the article "what if vscode can't load tkinter". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report