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

m1 安装 tidevice 成功,执行 tidevice version 报错 #103

Open
jiaxw32 opened this issue May 26, 2021 · 3 comments
Open

m1 安装 tidevice 成功,执行 tidevice version 报错 #103

jiaxw32 opened this issue May 26, 2021 · 3 comments

Comments

@jiaxw32
Copy link

jiaxw32 commented May 26, 2021

m1 上安装各种问题啊,希望可以优化解决下

执行安装脚本 pip3 install -U "tidevice[openssl]"

Pillow 报错,解决方案参考: 苹果Macbook Pro 13 M1芯片安装Pillow的正确姿势

手动安装 Pillow,之后再执行安装脚本,安装成功,最终提示成功 如下:

Successfully installed cached-property-1.5.2 colored-1.4.2 logzero-1.7.0 pyOpenSSL-20.0.1 tidevice-0.4.8

执行 tidevice version 报错:

Traceback (most recent call last):
  File "/Users/admin/Library/Python/3.8/bin/tidevice", line 5, in <module>
    from tidevice.__main__ import main
  File "/Users/admin/Library/Python/3.8/lib/python/site-packages/tidevice/__init__.py", line 7, in <module>
    from ._device import BaseDevice as Device
  File "/Users/admin/Library/Python/3.8/lib/python/site-packages/tidevice/_device.py", line 30, in <module>
    from PIL import Image
  File "/Users/admin/Library/Python/3.8/lib/python/site-packages/PIL/Image.py", line 94, in <module>
    from . import _imaging as core
ImportError: dlopen(/Users/admin/Library/Python/3.8/lib/python/site-packages/PIL/_imaging.cpython-38-darwin.so, 2): no suitable image found.  Did find:
	/Users/admin/Library/Python/3.8/lib/python/site-packages/PIL/_imaging.cpython-38-darwin.so: mach-o, but wrong architecture
	/Users/admin/Library/Python/3.8/lib/python/site-packages/PIL/_imaging.cpython-38-darwin.so: mach-o, but wrong architecture

查看 _imaging.cpython-38-darwin.so 架构

file /Users/admin/Library/Python/3.8/lib/python/site-packages/PIL/_imaging.cpython-38-darwin.so

输出结果

/Users/admin/Library/Python/3.8/lib/python/site-packages/PIL/_imaging.cpython-38-darwin.so: Mach-O 64-bit bundle x86_64
@codeskyblue
Copy link
Collaborator

我的的是M1 python 3.9 安装完之后,看样子没什么问题

@codeskyblue
Copy link
Collaborator

See this issue python-pillow/Pillow#5093 this may help you.

@jiaxw32
Copy link
Author

jiaxw32 commented May 26, 2021

使用 file 命令查看 Pillow 架构,如果安装的是 x86_64 架构的 Pillow

➜ $ file /Users/admin/Library/Python/3.8/lib/python/site-packages/PIL/_imaging.cpython-38-darwin.so
/Users/admin/Library/Python/3.8/lib/python/site-packages/PIL/_imaging.cpython-38-darwin.so: Mach-O 64-bit bundle x86_64

这样执行

$ arch -x86_64 tidevice version

arm64 架构的 Pillow

➜ $ file  /Users/admin/Library/Python/3.8/lib/python/site-packages/PIL/_imaging.cpython-38-darwin.so
/Users/admin/Library/Python/3.8/lib/python/site-packages/PIL/_imaging.cpython-38-darwin.so: Mach-O 64-bit bundle arm64

直接执行即可:

➜ $ tidevice -v
0.4.8

另外官网 没有找到 arm 架构的安装包,我是从这里下载的:

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

2 participants