-
-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tkinter application doesn't run from source build on Windows #58955
Comments
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 <module>
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 <module>
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() |
For the record, the script works fine under Linux. |
Reproduced here as well. |
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). |
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. |
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 <Tool added to each build configuration in PCbuild\_tkinter.vcproj (can be added through the UI, of course). |
Presumably out of date as we're now on 3.5. |
This bug report is over a decade old. Is it still relevant? |
I sure hope it's no longer relevant! Pretty sure we definitely copy the mentioned DLLs around now. |
I have run, tested, and patched IDLE in locally compiled main at least since summer 2012, probably a bit longer. I had to copy the dlls for awhile until Zach Ware fixed external.bat to make tkinter work properly without fuss. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: