0

I'm following helloworld example using Guizero from https://lawsie.github.io/guizero/ Below codes

from guizero import App

app = App(title="Hello world")

app.display()

If I run from the terminal runs fine. But if I run from VSCode I'm getting below error:

tkinter did not import successfully. Please check your setup.
ArindamD
  • 3
  • 2
  • Hello, I have couple of questions: 1. What version of Python is set in VSCode (bottom left corner of the window)? 2. Are you using virtual environment and is tkinter installed there too? 3. How do you import tkinter in your code? – Tony Feb 17 '21 at 11:11
  • @T0ny1234 I'm on macOS Catalina. Python 3.7.3. I'm following instruction from https://lawsie.github.io/guizero/ . So all I did for mac is `pip3 install guizero` . Then used the above code snippet i.e. hello world. Let me know if you need any further information. – ArindamD Feb 17 '21 at 16:34

1 Answers1

0

I've found the solution after setting the correct Python interpreter for VSCode. Initially that was different. Hence from command line it was working fine but not from within the VSCode.

ArindamD
  • 3
  • 2