【已解决】tkinterdnd2 mach-o file, but is an incompatible architecture (have ‘x86_64‘, need ‘arm64‘)

在执行roop换脸项目的时候,日志报错来源:

./run.py                         
Traceback (most recent call last):
  File "/Users/a16616/miniconda3/lib/python3.11/site-packages/tkinterdnd2/TkinterDnD.py", line 53, in _require
    TkdndVersion = tkroot.tk.call('package', 'require', 'tkdnd')
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: dlopen(/Users/a16616/miniconda3/lib/python3.11/site-packages/tkinterdnd2/tkdnd/osx64/libtkdnd2.9.2.dylib, 0x0006): tried: '/Users/a16616/miniconda3/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/a16616/miniconda3/lib/python3.11/site-packages/tkinterdnd2/tkdnd/osx64/libtkdnd2.9.2.dylib' (no such file), '/Users/a16616/miniconda3/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/a16616/VscodeProject/GithubProjects/roop/./run.py", line 6, in <module>
    core.run()
  File "/Users/a16616/VscodeProject/GithubProjects/roop/roop/core.py", line 219, in run
    window = ui.init(start, destroy)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/a16616/VscodeProject/GithubProjects/roop/roop/ui.py", line 48, in init
    ROOT = create_root(start, destroy)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/a16616/VscodeProject/GithubProjects/roop/roop/ui.py", line 61, in create_root
    root = CTk()
           ^^^^^
  File "/Users/a16616/VscodeProject/GithubProjects/roop/roop/ui.py", line 42, in __init__
    self.TkdndVersion = TkinterDnD._require(self)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/a16616/miniconda3/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.

之前通过pip install tkinterdnd2安装tkinterdnd2,所以问题出在tkinterdnd2库和运行系统不匹配,经查github issue,发现的确有人已经出现操作系统不适配问题:

https://github.com/pmgagne/tkinterdnd2/issues/7

I have uploaded a universal version of tkinterdnd2 to pypi. To install it, I suggest using “pip install tkinterdnd2-universal”. If you plan on using pyinstaller, please use the hook file provided in the repository.
https://github.com/blacklein/tkinterdnd2-universal

解决方案:
pip install tkinterdnd2-universal

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值