-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
macos-13 Python can't find Tcl/Tk 8.6 shared libraries #11074
Comments
Hi @WeisLeDocto , Thank you for your patience and for bringing this to our attention. We are currently working on a solution to address the issue you're facing. We ask that you bear with us while we resolve it. In the meantime, if you have any additional information or questions, feel free to let us know. We appreciate your understanding and will keep you updated as we make progress. |
The issue you’re encountering might be due to the fact that the python -c "import tkinter" command works fine for all our macOS runner images, including macOS-13 and macOS-14. This is because these images come pre-configured with the necessary Tcl/Tk libraries, so Python can directly use the already installed version of Tcl/Tk without requiring manual installation or symlink creation. In fact, if you use the following simple python -c "import tkinter" command, it should work without additional setup:
this command ensures that tkinter imports and outputs the version successfully using the pre-installed libraries available in the runner image. |
Thank you for your swift reply. name: tkinter minimal
on:
workflow_dispatch:
jobs:
minimal:
runs-on: macos-13
steps:
- name: import tkinter
run: python -c "import tkinter" I should've tried that first. 😅 However, the only Python version installed by default is The following workflow crashes, still with the same Python error as previously: name: tkinter minimal
on:
workflow_dispatch:
jobs:
minimal:
runs-on: macos-13
steps:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: import tkinter
run: python3.9 -c "import tkinter" Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/runner/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/tkinter/__init__.py", line 37, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: dlopen(/Users/runner/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/lib-dynload/_tkinter.cpython-39-darwin.so, 0x0002): Library not loaded: /usr/local/opt/tcl-tk/lib/libtcl8.6.dylib
Referenced from: <0E547FD7-F776-378C-B4DE-8D241CDFE19E> /Users/runner/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/lib-dynload/_tkinter.cpython-39-darwin.so
Reason: tried: '/usr/local/opt/tcl-tk/lib/libtcl8.6.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/tcl-tk/lib/libtcl8.6.dylib' (no such file), '/usr/local/opt/tcl-tk/lib/libtcl8.6.dylib' (no such file), '/usr/local/lib/libtcl8.6.dylib' (no such file), '/usr/lib/libtcl8.6.dylib' (no such file, not in dyld cache) Looks like I cannot open an issue in the |
Hi @WeisLeDocto name: tkinter minimal on: jobs:
|
The following workflow runs gracefully 👍 name: tkinter minimal
on:
workflow_dispatch:
jobs:
build:
runs-on: macos-13
steps:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Adding Symlink
run: ln -sf /usr/local/opt/tcl-tk@8 /usr/local/opt/tcl-tk
- name: import tkinter
run: python3.9 -c "import tkinter; print(f'Tkinter imported successfully. Version {tkinter.TkVersion}')" Many thanks for your help ! Will the runner images be fixed to avoid having to symlink |
We're investigating this issue and working on a fix. We'll keep you informed as soon as it's resolved. |
Description
Hi !
I'm experiencing a similar issue on
macos-13
runner as described in #6442 formacos-12
and #4931 formacos-11
.Basically, Python fails to find
libtcl8.6.dylib
in all the locations in tries.Unlike the referenced issues, the bug is not solved by adding the symlinks suggested in #4931.
(I still added them in the minimal repro example for demonstration)
I'm demonstrating the issue with Python 3.9, but I'm also experiencing it for versions 3.7, 3.8 and 3.10.
Platforms affected
Runner images affected
Image version and build link
Version: 20241125.399
https://github.com/TissueEngineeringLab/MyoFInDer/actions/runs/12116070585/job/33775709298
Is it regression?
Yes
Version: 20241023.237
Not exactly the same workflow, but symlink could be found by Python.
import tkinter
is included in theimport myofinder
call, in the Import MyoFInDer step.Link: https://github.com/TissueEngineeringLab/MyoFInDer/actions/runs/11629304885/job/32386049285
Expected behavior
tkinter
can be imported in PythonActual behavior
import tkinter
crashes with error:Repro steps
Note that the
brew install tcl-tk
step was not included in the last successful run, I added it in my minimal example to make sure tcl/tk is installedThe text was updated successfully, but these errors were encountered: