I use Enthought Canopy as my Python 3 environment, and I recently got a new-to-me Windows machine. Having switched from Mac, I started from scratch as far as all my modules go in Canopy. I've been messing with GUIs lately, and when I got on my new machine to start a little app, I try to import tkinter
but got this traceback:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-5-b98d59735c04> in <module>()
----> 1 import tkinter
C:\Users\User\AppData\Local\Enthought\Canopy\edm\envs\User\lib\tkinter\__init__.py in <module>()
33 import sys
34
---> 35 import _tkinter # If this fails your Python may not be configured for Tk
36 TclError = _tkinter.TclError
37 from tkinter.constants import *
ImportError: DLL load failed: The specified module could not be found.
What perplexes me is that there is a tkinter folder where the rest of my Canopy modules are, and the error is actually coming from __init__.py
The pudding is really on line 35 of that __init__ file where it says "if this fails your Python may not be configured for Tk". Iirc, my Mac setup of Canopy already had Tkinter, or it was in Canopy's package manager, making installation really quick and painless. It is not in Canopy's package manager, in any of the Canopy repositories.