You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python 3.7.13 macOS: tk.h version (8.6) doesn't match libtk.a version (8.5) #402
Description:
There seems to be a mistmatch between the tkinter versions with Python 3.7 on macOS.
Action version:
v3
Which at the time of writting is v3.1.2
Platform:
Ubuntu
macOS
Windows
Runner type:
Hosted
Self-hosted
Tools version:
Python 3.7
Specically 3.7.13
Current runner version: '2.291.1'
macOS (latest) 11.6.5 20G527
Repro steps:
This simple script opens a tkinter window and closes it after 5 seconds:
importtkinterastkroot=tk.Tk()
label=tk.Label(root, text="Hello World!")
label.pack(padx=20, pady=20)
root.after(5000, root.destroy) # Close the Window after 5 secondsroot.mainloop()
Expected behavior:
The Python script to run without throwing an exception
Actual behavior:
An exception thrown by Python:
Traceback (most recent call last):
File "tk_min.py", line 9, in <module>
root = tk.Tk()
File "/Users/runner/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/tkinter/__init__.py", line 2025, in __init__
self._loadtk()
File "/Users/runner/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/tkinter/__init__.py", line 2040, in _loadtk
% (_tkinter.TK_VERSION, tk_version))
RuntimeError: tk.h version (8.6) doesn't match libtk.a version (8.5)
changed the title [-]Python 3.7 macOS: tk.h version (8.6) doesn't match libtk.a version (8.5)[/-][+]Python 3.7.13 macOS: tk.h version (8.6) doesn't match libtk.a version (8.5)[/+]on May 6, 2022
tk.h version (8.6) doesn't match libtk.a version (8.5)
(the last one is about $DISPLAY, which is a reasonable error, but I don't know why {macos-10.15}x{python3.10} hits that)
We started seeing this on our team two weeks ago, when it only affected the 3.7 environment, then this week it became 3.7 and 3.8, which makes me suspect strongly something got rebuilt and it's a bug in the runner environment.
Oddly, this exactly same error was fixed 7 years ago(!) in brew: Homebrew/legacy-homebrew#41728. Did GitHub accidentally reproduce this bug? Are they using brew packages from way back then?
Current workaround is to fix the patch version of the python to 3.7.12
- name: Set up Python 3.7
uses: actions/setup-python@v3
with:
python-version: 3.7.12
Apparently we have some interference between system Tk /System/Library/Frameworks/Tk.framework/Versions/8.5 and brew Tk /usr/local/Cellar/tcl-tk/8.6.12_1 but the exact reason of the break change needs more investigation
Activity
[-]Python 3.7 macOS: tk.h version (8.6) doesn't match libtk.a version (8.5)[/-][+]Python 3.7.13 macOS: tk.h version (8.6) doesn't match libtk.a version (8.5)[/+]carlosperate commentedon May 6, 2022
Okay, so it looks like the issue is specifically contained with 3.7.13, versions 3.7.12 and .11 work on macOS (the Windows issues on this run are due to these specific Python 3.7 versions not being available on Windows):
https://github.com/carlosperate/pyinstaller-test/actions/runs/2282135890
CI: Use older Py 3.7 version to workaround issue with Python action.
dsame commentedon May 9, 2022
Hello @carlosperate
Thanks for your note - i am able to reproduce and confirm the problem exists
@marko-zivic-93 please remove needs triage tag, this issue is confirmed bug
QuLogic commentedon May 14, 2022
Based on new latest test runs, this has now spread to Python 3.8 on GitHub Actions as well.
kousu commentedon May 17, 2022
I just found this too, I have a reproducer here with an example run. The pattern of failures looks like
🟢 Matrix Test of Python 3.6 on macos-latest
🔴 Matrix Test of Python 3.7 on macos-latest
🔴 Matrix Test of Python 3.8 on macos-latest
🟢 Matrix Test of Python 3.9 on macos-latest
🟢 Matrix Test of Python 3.10 on macos-latest
🟢 Matrix Test of Python 3.6 on macos-10.15
🔴 Matrix Test of Python 3.7 on macos-10.15
🔴 Matrix Test of Python 3.8 on macos-10.15
🟢 Matrix Test of Python 3.9 on macos-10.15
🔴 Matrix Test of Python 3.10 on macos-10.15
Except for the last one, all of the failures are
(the last one is about
$DISPLAY, which is a reasonable error, but I don't know why {macos-10.15}x{python3.10} hits that)We started seeing this on our team two weeks ago, when it only affected the 3.7 environment, then this week it became 3.7 and 3.8, which makes me suspect strongly something got rebuilt and it's a bug in the runner environment.
Oddly, this exactly same error was fixed 7 years ago(!) in brew: Homebrew/legacy-homebrew#41728. Did GitHub accidentally reproduce this bug? Are they using brew packages from way back then?
dsame commentedon Jun 15, 2022
Current workaround is to fix the patch version of the python to 3.7.12
Apparently we have some interference between system Tk
/System/Library/Frameworks/Tk.framework/Versions/8.5and brew Tk/usr/local/Cellar/tcl-tk/8.6.12_1but the exact reason of the break change needs more investigation