msg160198 - (view) |
Author: Vinay Sajip (vinay.sajip) *  |
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) *  |
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) *  |
Date: 2012-05-08 15:17 |
Reproduced here as well. |
|
|
msg160218 - (view) |
Author: Vinay Sajip (vinay.sajip) *  |
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) *  |
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) *  |
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) *  |
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. |
|
|