Issue 14750: Tkinter application doesn't run from source build on Windows (original) (raw)

Issue14750

Created on 2012-05-08 11:43 by vinay.sajip, last changed 2022-04-11 14:57 by admin.

Files
File name Uploaded Description Edit
copy_tcl.bat.txt vinay.sajip,2012-05-08 22:00 Batch file to copy Tcl/Tk DLLs to build directory
Messages (8)
msg160198 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2012-05-08 11:43
I'm now getting failures to import tkinter on Windows: C:\Users\Vinay\Projects\scratch>..\cpython\PCbuild\python tkhello.py Traceback (most recent call last): File "tkhello.py", line 1, in from tkinter import * File "<frozen importlib._bootstrap>", line 977, in _find_and_load File "<frozen importlib._bootstrap>", line 596, in load_module File "<frozen importlib._bootstrap>", line 262, in module_for_loader_wrapper File "<frozen importlib._bootstrap>", line 484, in _load_module File "C:\Users\Vinay\Projects\cpython\lib\tkinter\__init__.py", line 36, in from tkinter import _fix ImportError: cannot import name _fix I'm not sure if this is an importlib issue or a tkinter one, but with a recent build (30 April) this worked OK. The tkhello.py script is just from tkinter import * root = Tk() w = Label(root, text="Hello, world!") w.pack() root.mainloop()
msg160201 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-05-08 12:39
For the record, the script works fine under Linux. Vinay, can you bisect and find out which revision introduced the issue?
msg160207 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2012-05-08 15:17
Reproduced here as well.
msg160218 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2012-05-08 19:01
I went back a fair way, and the failure still keeps happening. So now I'm wondering - is a Tk app *supposed* to work from a source build? I've verified that the test script works OK when run from an installed Python. So, this issue may be invalid, if we don't care about running Tk apps from a source build (if so, sorry for the noise) - or if we do care, then it's not an importlib issue, but Tk-related (I'm not a Tk expert by any means, so I'm not sure what needs to be done to make a Tk app work from a source build).
msg160219 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-05-08 19:03
> I went back a fair way, and the failure still keeps happening. So now > I'm wondering - is a Tk app *supposed* to work from a source build? Does it work with 3.2? Did you try debugging at the prompt? e.g. looking what tkinter.__file__ is, etc.
msg160223 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2012-05-08 20:27
> Does it work with 3.2? I'm not able to build 3.2 - make_buildinfo fails, seemingly because it can't find some Subversion-related files. I'll keep looking into it.
msg160231 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2012-05-08 22:00
The test script works if tcl85.dll and tk85.dll are copied into the build directory. This can be done using a small batch file and the XML added to each build configuration in PCbuild\_tkinter.vcproj (can be added through the UI, of course).
msg222665 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-07-10 13:40
Presumably out of date as we're now on 3.5.
History
Date User Action Args
2022-04-11 14:57:30 admin set github: 58955
2019-04-26 18:50:26 BreamoreBoy set nosy: - BreamoreBoy
2014-07-10 13:41:57 brian.curtin set nosy: - brian.curtin
2014-07-10 13:40:15 BreamoreBoy set nosy: + BreamoreBoymessages: +
2012-05-08 22:00:19 vinay.sajip set files: + copy_tcl.bat.txtcomponents: + Tkintertitle: importlib fails with tkinter application on Windows -> Tkinter application doesn't run from source build on Windowskeywords: + patch, needs reviewnosy: + gpolo, - brett.cannonmessages: + stage: patch review
2012-05-08 20:27:10 vinay.sajip set messages: +
2012-05-08 19:03:38 pitrou set messages: +
2012-05-08 19:01:25 vinay.sajip set messages: +
2012-05-08 15:17:23 brian.curtin set messages: +
2012-05-08 12:39:49 pitrou set nosy: + brian.curtin, pitroumessages: +
2012-05-08 11:43:28 vinay.sajip create