Tkinter ( tkinter ) not working in Vs code When Imported #15864
Unanswered
CoderTeam1
asked this question in
Q&A
Replies: 4 comments
|
please tell why this happened |
0 replies
|
Hi @CoderTeam1, thank you for reaching out. Does your code work when you run it outside of VS Code? Also, how did you set up your conda environment? |
0 replies
|
sorry couldnt reply earlier I am in india and also I didnt think of it being working outside vs code I will try and let you know and I use the base environment for every project ( first project in python ) I read articles yesterday and found out i was using code of python 2 so i changed the code to python 3 but still it is not working |
0 replies
|
If it's not working outside of VS Code then there's a problem in your code, not with the extension. I will convert this issue to a discussion, so that others can chime in, and hopefully help you. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Environment data
python.languageServersetting: XXX[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (
python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]Expected behaviour
It creates a gui with4 textboxes
Actual behaviour
gives 100 errors
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
import Tkinter
import tkMessageBox
top = Tkinter.Tk()
L1 = Label(top, text="My calculator",).grid(row=0,column=1)
L2 = Label(top, text="Number 1",).grid(row=1,column=0)
L3 = Label(top, text="Number 2",).grid(row=2,column=0)
L4 = Label(top, text="Operator",).grid(row=3,column=0)
L4 = Label(top, text="Answer",).grid(row=4,column=0)
Logs
Output for
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)ModuleNotFoundError: No module named 'Tkinter' PS F:\abeer\abeer pendrive\CODING\code\Abeer Codes\Calculater> & F:/abeer/CODING/Anaconda/python.exe "f:/abeer/abeer pendrive/CODING/code/Abeer Codes/Calculater/script.py" Traceback (most recent call last): File "f:/abeer/abeer pendrive/CODING/code/Abeer Codes/Calculater/script.py", line 3, in import tkMessageBox ModuleNotFoundError: No module named 'tkMessageBox' PS F:\abeer\abeer pendrive\CODING\code\Abeer Codes\Calculater> & F:/abeer/CODING/Anaconda/python.exe "f:/abeer/abeer pendrive/CODING/code/Abeer Codes/Calculater/script.py" Traceback (most recent call last): File "f:/abeer/abeer pendrive/CODING/code/Abeer Codes/Calculater/script.py", line 1, in from Tkinter import * ModuleNotFoundError: No module named 'Tkinter' PS F:\abeer\abeer pendrive\CODING\code\Abeer Codes\Calculater>
All reactions