setup-python: Python 3.10.11 macOS: tk.h version (8.5) doesn't match libtk.a version (8.6)

Description: Azure appears to be slowly rolling out image version 20230408.1. This seems to have hit our Python 3.10 jobs with the error:

RuntimeError: tk.h version (8.5) doesn't match libtk.a version (8.6)

This didn’t affect the 3.9 job, which is also using the 20230408.1 image.

Action version: 0.214.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version: 3.10.11

Repro steps:
https://dev.azure.com/matplotlib/matplotlib/_build/results?buildId=32988&view=logs&j=de24e77b-0042-5832-9c98-cc3b6fa75eaf&t=6ee7601c-9c40-4d21-ae8c-c759c54cae95

Expected behavior: Tk works correctly.

Actual behavior: A runtime error is raised when attempting to import Tk:

RuntimeError: tk.h version (8.5) doesn't match libtk.a version (8.6)

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 6
  • Comments: 22 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Just an FYI I’m encountering the same issue with my rfswarm builds, the issue seems to be specific to python 3.10 on MacOS

Not sure how helpful this is but I’ll add it in case it helps find the cause:

OS Python Ver Test Result
ubuntu-latest 3.7 Pass
ubuntu-latest 3.8 Pass
ubuntu-latest 3.9 Pass
ubuntu-latest 3.10 Pass
ubuntu-latest 3.11 Pass
macos-latest 3.7 Pass
macos-latest 3.8 Pass
macos-latest 3.9 Pass
macos-latest 3.10 Fail
macos-latest 3.11 Pass
windows-latest 3.7 Pass
windows-latest 3.8 Pass
windows-latest 3.9 Pass
windows-latest 3.10 Pass
windows-latest 3.11 Pass

Here’s my stack trace from stderr:

Traceback (most recent call last):
  File "/Users/runner/work/rfswarm/rfswarm/rfswarm_manager/rfswarm.py", line 6954, in <module>
    core = RFSwarmCore()
  File "/Users/runner/work/rfswarm/rfswarm/rfswarm_manager/rfswarm.py", line 2223, in __init__
    base.gui = RFSwarmGUI()
  File "/Users/runner/work/rfswarm/rfswarm/rfswarm_manager/rfswarm.py", line 3216, in __init__
    self.root = tk.Tk()
  File "/Users/runner/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/tkinter/__init__.py", line 2301, in __init__
    self._loadtk()
  File "/Users/runner/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/tkinter/__init__.py", line 2317, in _loadtk
    raise RuntimeError("tk.h version (%s) doesn't match libtk.a version (%s)"
RuntimeError: tk.h version (8.5) doesn't match libtk.a version (8.6)

A quick internet search for “RuntimeError: tk.h version (8.5) doesn't match libtk.a version (8.6)” brought me here.

Let me know if I can be of any more help?

Dave.