Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.1k 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...