Skip to content
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

Unable to run on Mac with M1 #3

Closed
d4rky-pl opened this issue Jul 4, 2023 · 6 comments
Closed

Unable to run on Mac with M1 #3

d4rky-pl opened this issue Jul 4, 2023 · 6 comments

Comments

@d4rky-pl
Copy link

d4rky-pl commented Jul 4, 2023

Regardless of what I do I'm not able to figure out a way to make tkdnd work on Mac.

I've already:

  • Installed python-tk
  • Installed tcl-tk
  • Installed python 3.11.4 with asdf using stack overflow instruction
  • Cleaned up poetry multiple times

I keep getting this error:

Traceback (most recent call last):
  File "/Users/matyas/Library/Caches/pypoetry/virtualenvs/gif2tgsticker-lnQPwnqZ-py3.11/lib/python3.11/site-packages/tkinterdnd2/TkinterDnD.py", line 53, in _require
    TkdndVersion = tkroot.tk.call('package', 'require', 'tkdnd')
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: dlopen(/Users/matyas/Library/Caches/pypoetry/virtualenvs/gif2tgsticker-lnQPwnqZ-py3.11/lib/python3.11/site-packages/tkinterdnd2/tkdnd/osx64/libtkdnd2.9.2.dylib, 0x0006): tried: '/Users/matyas/Library/Caches/pypoetry/virtualenvs/gif2tgsticker-lnQPwnqZ-py3.11/lib/python3.11/site-packages/tkinterdnd2/tkdnd/osx64/libtkdnd2.9.2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/matyas/Library/Caches/pypoetry/virtualenvs/gif2tgsticker-lnQPwnqZ-py3.11/lib/python3.11/site-packages/tkinterdnd2/tkdnd/osx64/libtkdnd2.9.2.dylib' (no such file), '/Users/matyas/Library/Caches/pypoetry/virtualenvs/gif2tgsticker-lnQPwnqZ-py3.11/lib/python3.11/site-packages/tkinterdnd2/tkdnd/osx64/libtkdnd2.9.2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/matyas/a/gif2tgsticker/gif2tgsticker.py", line 19, in <module>
    root = tkd.TkinterDnD.Tk()
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/matyas/Library/Caches/pypoetry/virtualenvs/gif2tgsticker-lnQPwnqZ-py3.11/lib/python3.11/site-packages/tkinterdnd2/TkinterDnD.py", line 285, in __init__
    self.TkdndVersion = _require(self)
                        ^^^^^^^^^^^^^^
  File "/Users/matyas/Library/Caches/pypoetry/virtualenvs/gif2tgsticker-lnQPwnqZ-py3.11/lib/python3.11/site-packages/tkinterdnd2/TkinterDnD.py", line 55, in _require
    raise RuntimeError('Unable to load tkdnd library.')
RuntimeError: Unable to load tkdnd library.

Is there any chance you could create a CLI-only version of this tool? I really don't need the TK GUI 😅

@iAmGhost
Copy link
Owner

iAmGhost commented Jul 5, 2023

I think it will be working if you install x86_64 Python instead of ARM.

@MulmVerbot
Copy link

i have the same issue, its working on my Intel Mac Mini, but not on my m1 Mac Book.

@iAmGhost
Copy link
Owner

iAmGhost commented Sep 5, 2023

Seems python-tkdnd is not working for aarch64 platform.
I won't fix it myself since It's not blocker(you can use x86 version of Python) and I don't have Apple Silicon Mac for replication, Feel free to contribute.

@iAmGhost iAmGhost closed this as completed Sep 5, 2023
@iAmGhost iAmGhost pinned this issue Sep 5, 2023
@hkleungai
Copy link

hkleungai commented Feb 10, 2024

Maybe a late response, i find a workaround in one of the tkinterdnd2 issue.

poetry remove tkinterdnd2
poetry add tkinterdnd2-universal

With this the app runs fine on my Mac. ❤️

@Squiblydoo
Copy link

Posting here for the citizens of the future.
In regards to the tkinterdnd2 issue, I myself am now a maintainer of the tkinterdnd2 repository (github and pypi). I've included the binaries from tkinterdnd2-universal into the tkinterdnd2 repository.

The author of tkinterdnd2-universal deleted their GitHub account and is no longer maintained, and as a result, that PyPI package will fail to work with Python3.13 and newer.

I've updated tkinterdnd2 to account for the change in Python3.13. I am also intending to provide support for tkinterdnd2 into the future to ensure its availability.

@iAmGhost
Copy link
Owner

@Squiblydoo Thanks for doing that, I've updated tkinterdnd2 to latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants