0

I've been searching for it but could not find anything on the net on this topic.

When I'm working on a programm in python 3.5 which imports tkinter or pyglet I'm perfectly able to start it from the command line on my Linux Mint installation. As soon as I try to start it from pycharm or Visual Studio Code I get an error.

It is for tkinter:

Traceback (most recent call last):  File "/home/b...", line 3, in <module>
    import tkinter as tk
  File "/usr/lib/python3.5/tkinter/__init__.py", line 35, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named '_tkinter'

Both, the tkinter and the pyglet script, are working when they are started from idle3 (with F5).

Can anyone help me out?

Best

B.

Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
Ballfuss
  • 5
  • 1
  • 3
  • 1
    Possible duplicate of [Tkinter: "Python may not be configured for Tk"](https://stackoverflow.com/questions/5459444/tkinter-python-may-not-be-configured-for-tk) – Norrius Feb 17 '18 at 13:32
  • Which would be strange because it runs from the xterm but not from within the IDE. – Ballfuss Feb 17 '18 at 14:16
  • Does this answer your question? [Why does tkinter (or turtle) seem to be missing or broken? Shouldn't it be part of the standard library?](https://stackoverflow.com/questions/76105218/why-does-tkinter-or-turtle-seem-to-be-missing-or-broken-shouldnt-it-be-part) – Karl Knechtel Apr 29 '23 at 02:19

1 Answers1

1

i'm having the same issue. The problem lie with Linux Mint Software Manager. If your vs code is install via Software Manager, it will be install in Flatpak virtual sandbox. Just download and run vs code from its homepage will do.

Mike Mai
  • 26
  • 1
  • 1
    Confirmed! Installed VS Code via the *.deb installer and after chosing the right interpreter it works now! Thanks a lot! – Ballfuss Mar 12 '18 at 09:08