Python 3.7.13 macOS: tk.h version (8.6) doesn't match libtk.a version (8.5)
See original GitHub issueDescription: 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:
import tkinter as tk
root = 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 seconds
root.mainloop()
With this workflow:
name: Test Python Tk
on: [push, pull_request]
jobs:
tests-poetry:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
fail-fast: false
name: Py ${{ matrix.python-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Prepare Ubuntu xvfb
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libxkbcommon-x11-0 xvfb
- name: Run tk script (closes itself after 5 seconds) - Ubuntu
if: runner.os == 'Linux'
run: xvfb-run python tk_min.py
- name: Run tk script (closes itself after 5 seconds)
if: runner.os != 'Linux'
run: python tk_min.py
Works in all Python versions and operating systems except 3.7 on macOS:
- https://github.com/carlosperate/pyinstaller-test/actions/runs/2281830156
- https://github.com/carlosperate/pyinstaller-test/commit/a216015790bed76f486725389be0f1d892a6b2d3
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)
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Not Able to Build Some Versions of Python on M1 at 12.3.1
I trying to build older version of python such as 3.6, 3.7, 3.8 using pyenv and having build failures. I am on apple...
Read more >tkinter — Python interface to Tcl/Tk — Python 3.7.14 ...
Tkinter 8.5 reference: a GUI for Python. On-line reference material. ... Change '8.6' to match the version of your Tcl/Tk installation.
Read more >python not using tkinter 8.6 installed with homebrew on Mac
Python was installed with homebrew. When I import tkinter, I get version 8.5.9, and I want version 8.6 instead. brew info tcl-tk gives...
Read more >python@3.8 - Homebrew Formulae
python @3.8. Install command: brew install python@3.8. Interpreted, interactive, object-oriented programming language. https://www.python.org/.
Read more >Installing Python 3 and Pyenv on MacOS, Windows, and Linux
We can confirm if we have a system python version installed and see what version ... could fail completely, indicting that python is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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: https://github.com/Homebrew/legacy-homebrew/pull/41728. Did GitHub accidentally reproduce this bug? Are they using brew packages from way back then?
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