0

I was working on an app with Tkinter and everything was working fine, but after modifying a function (that has nothing to do with the Tkinter environment) all of a sudden I started getting the following error:

from tkinter import * ImportError: No module named tkinter

I tried opening another Tkinter file to see if it had something to do with my app, but on the other file, I'm also seeing the same error. So I'm guessing it doesn't have to do with my app. Is there any way that Tkinter uninstalled itself if it was working before? I'm also getting the same error when importing Pandas. It's weird because it was all working before. Has anyone encountered this problem before? What could be the problem?

  • 4
    No, tkinter can't uninstall itself. – Bryan Oakley Apr 03 '20 at 17:23
  • You might be running your code with a different Python than you used previously - double check you haven’t changed how you’re running your code, or that you haven’t inadvertently created a new virtual environment. – nneonneo Apr 03 '20 at 19:52
  • Now is working, was using Atom Run Script Add-on, that's why it was giving me problems. But thanks anyway – Xavier Granda Apr 03 '20 at 23:36
  • _jus saying_ : though while installing python, you have a choice to install tcl with it, if u choose custom installation mode, in the newer versions ig – Delrius Euphoria Jul 25 '20 at 09:34
  • One strong possibility is that you used Python 2 instead of Python 3 when it failed. In Python 2, the module name was [`Tkinter`](https://docs.python.org/2/library/tkinter.html) (capital K). Another is that you are using the Ubuntu or Debian packaged Python version, which [installs Tkinter separately](https://stackoverflow.com/questions/26702119/installing-tkinter-on-ubuntu-14-04). – Martijn Pieters Nov 18 '20 at 10:54

1 Answers1

0

No python module can uninstall itself. You can type pip install tkinter again in cmd.