Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.2k views
in Technique[技术] by (71.8m points)

Python import tkinter throws error on windows - DLL load failed: The specified module could not be found


I can't use tkinter library when coding.
**Could you please advise me, what to do?
**

Errors:

  • For code:
import tkinter
tkinter._test()

ImportError: DLL load failed: The specified module could not be found.
import _tkinter # If this fails your Python may not be configured for Tk

  • For code:
import Tkinter
tkinter._test()

ModuleNotFoundError: No module named 'Tkinter'

  • For code with libraries tcl86t.dll and tk86t.dll in the same folder as *.py file:
import tkinter
tkinter._test()

TclError: Can't find a usable init.tcl in the following directories:
F:/Nauka/Python/lib/tcl8.6
D:/Spyder/lib/tcl8.6
D:/lib/tcl8.6
D:/Spyder/library
D:/library
D:/tcl8.6.9/library
D:/tcl8.6.9/library

My environment:

  • Python 3.9.1 64 bit
  • Windows 10 64 bit
  • Working on Spyder IDE

I have following packages installed:

  • tk==0.1.0
  • tk-tools==0.13.0
  • Tcl/Tk version 8.6

What I tried so far:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...