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

Add support for macOS ARM #127

Open
Tohrusky opened this issue Apr 15, 2023 · 12 comments
Open

Add support for macOS ARM #127

Tohrusky opened this issue Apr 15, 2023 · 12 comments

Comments

@Tohrusky
Copy link

In Mac OS arm, use pip to install, the libmediainfo.0.dylib is not found like. So I copy the lib in pypi pkg for macos x64, it work.

We found that in https://mediaarea.net/en/MediaInfo/Download/Mac_OS, libmediainfo.0.dylib is a universal lib for mac, so just add a package named like pymediainfo-6.0.1-py3-none-macosx_10_15_universal2.whl in PYPI, it can work

@sbraz
Copy link
Owner

sbraz commented Apr 15, 2023

Hi, the wheel for v6.0.1 contains the x86_64+arm64 dylib, see my comment here: #24 (comment)

If you get https://files.pythonhosted.org/packages/a7/73/9f6602d6356bcf4c671f0d10999365cff6ebade197050f910d92f7501838/pymediainfo-6.0.1-py3-none-macosx_10_15_x86_64.whl, it should work. What version did your pip install command try to install? I need all that info in order to help you.

@Tohrusky
Copy link
Author

just pip install pymediainfo

yep. I know the wheel for v6.0.1 contains the x86_64+arm64 dylib, but pip for arm mac will not install it.
To use pip install, a arm64 or universal2 tag like https://pypi.org/project/opencv-python/#files is needed ,or it will not install the Binary Wheel which contained the lib

@sbraz
Copy link
Owner

sbraz commented Apr 15, 2023

OK, so the wheel is fine but it lacks a universal2 tag, right? I assume I have to change

return 'py3', 'none', plat

I'll have to check this, the issue is that I don't have a MacOS system other than the AppVeyor CI so it makes it difficult to debug this.

@Tohrusky
Copy link
Author

Tohrusky commented Apr 15, 2023

https://github.com/Tohrusky/realcugan-ncnn-py/blob/main/setup.py
In my repo, I force-name the platform. Hope it can help ya lol

And when python < 3.9, universal2 tag is not enabled, so add a extra pkg with arm64 tag is more easy

@sbraz
Copy link
Owner

sbraz commented Apr 15, 2023

Thanks, that's really helpful. In my case, I probably also need to force a platform name because I run code on a non-universal2 Python apparently.

Do you know if pip will find the universal2 wheel properly even if sysconfig.get_platform() returns macosx-10.9-x86_64 or macosx-arm64? Is that something you can test?

Also why do you disable this tag before Python 3.9?

@Tohrusky
Copy link
Author

Tohrusky commented Apr 15, 2023

Do you know if pip will find the universal2 wheel properly even if sysconfig.get_platform() returns macosx-10.9-x86_64 or macosx-arm64? Is that something you can test?

When python >= 3.9, arm x86 and arm can find it. I have tested it in github action in the repo

Also why do you disable this tag before Python 3.9?

Python3.8 for arm seems not a official build.So the uni tag is enabled after 3.8

@cerrutopolaris
Copy link

Hi, when launch my application with pymedia info I have this error:
OSError: Failed to load library from libmediainfo.0.dylib, libmediainfo.dylib - dlopen(libmediainfo.0.dylib, 0x0006): tried: 'libmediainfo.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibmediainfo.0.dylib' (no such file), '/usr/lib/libmediainfo.0.dylib' (no such file, not in dyld cache), 'libmediainfo.0.dylib' (no such file), '/usr/local/lib/libmediainfo.0.dylib' (no such file), '/usr/lib/libmediainfo.0.dylib' (no such file, not in dyld cache), dlopen(libmediainfo.dylib, 0x0006): tried: 'libmediainfo.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibmediainfo.dylib' (no such file), '/usr/lib/libmediainfo.dylib' (no such file, not in dyld cache), 'libmediainfo.dylib' (no such file), '/usr/local/lib/libmediainfo.dylib' (no such file), '/usr/lib/libmediainfo.dylib' (no such file, not in dyld cache)

I have a problem with this library on my Mac arm m1/m2 mini.
Can I solve and fix this problem?

@Tohrusky
Copy link
Author

Tohrusky commented May 27, 2023

Hi, when launch my application with pymedia info I have this error:嗨,当使用 pymedia 信息启动我的应用程序时,我遇到此错误: OSError: Failed to load library from libmediainfo.0.dylib, libmediainfo.dylib - dlopen(libmediainfo.0.dylib, 0x0006): tried: 'libmediainfo.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibmediainfo.0.dylib' (no such file), '/usr/lib/libmediainfo.0.dylib' (no such file, not in dyld cache), 'libmediainfo.0.dylib' (no such file), '/usr/local/lib/libmediainfo.0.dylib' (no such file), '/usr/lib/libmediainfo.0.dylib' (no such file, not in dyld cache), dlopen(libmediainfo.dylib, 0x0006): tried: 'libmediainfo.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibmediainfo.dylib' (no such file), '/usr/lib/libmediainfo.dylib' (no such file, not in dyld cache), 'libmediainfo.dylib' (no such file), '/usr/local/lib/libmediainfo.dylib' (no such file), '/usr/lib/libmediainfo.dylib' (no such file, not in dyld cache)OSError:无法从libmediainfo.0.dylib加载库,libmediainfo.dylib - dlopen(libmediainfo.0.dylib, 0x0006): 尝试: 'libmediainfo.0.dylib' (没有这样的文件), '/System/Volumes/Preboot/Cryptexes/OSlibmediainfo.0.dylib' (没有这样的文件), '/usr/lib/libmediainfo.0.dylib' (没有这样的文件, 不在dyld cache中), 'libmediainfo.0.dylib' (没有这样的文件), '/usr/local/lib/libmediainfo.0.dylib' (没有这样的文件), '/usr/lib/libmediainfo.0.dylib' (没有这样的文件, 不在dyld cache中), dlopen(libmediainfo.dylib, 0x0006): 尝试: 'libmediainfo.dylib' (没有这样的文件), '/System/Volumes/Preboot/Cryptexes/OSlibmediainfo.dylib' (没有这样的文件), '/usr/lib/libmediainfo.dylib' (没有这样的文件, 不在 dyld 缓存中), 'libmediainfo.dylib' (没有这样的文件), '/usr/local/lib/libmediainfo.dylib' (没有这样的文件), '/usr/lib/libmediainfo.dylib' (没有这样的文件,不在 dyld 缓存中)

I have a problem with this library on my Mac arm m1/m2 mini.我的 Mac arm m1/m2 mini 上的这个库有问题。 Can I solve and fix this problem?我可以解决并解决此问题吗?

just copy a libmediainfo.dylib from here or the x86 mac pypi wheel to the package root directory.
its a universal2 lib.

@cerrutopolaris
Copy link

how I try this have this error
pip install https://files.pythonhosted.org/packages/a7/73/9f6602d6356bcf4c671f0d10999365cff6ebade197050f910d92f7501838/pymediainfo-6.0.1-py3-none-macosx_10_15_x86_64.whl
ERROR: pymediainfo-6.0.1-py3-none-macosx_10_15_x86_64.whl is not a supported wheel on this platform.

I downloaded
DyLib | v23.04
(https://mediaarea.net/download/binary/libmediainfo0/23.04/MediaInfo_DLL_23.04_Mac_x86_64+arm64.tar.bz2) but where should I place it and configure it?

Sorry in both cases I think I'm doing something wrong, can you be more detailed? Thank you

@Tohrusky
Copy link
Author

Tohrusky commented May 27, 2023

how I try this have this error pip install https://files.pythonhosted.org/packages/a7/73/9f6602d6356bcf4c671f0d10999365cff6ebade197050f910d92f7501838/pymediainfo-6.0.1-py3-none-macosx_10_15_x86_64.whl ERROR: pymediainfo-6.0.1-py3-none-macosx_10_15_x86_64.whl is not a supported wheel on this platform.

I downloaded DyLib | v23.04 (https://mediaarea.net/download/binary/libmediainfo0/23.04/MediaInfo_DLL_23.04_Mac_x86_64+arm64.tar.bz2) but where should I place it and configure it?

Sorry in both cases I think I'm doing something wrong, can you be more detailed? Thank you

not use pip, just download it, rename it to zip, unzip and find the lib.

to the package dir where you install it.

https://stackoverflow.com/questions/31384639/what-is-pythons-site-packages-directory

@cerrutopolaris
Copy link

how I try this have this error pip install https://files.pythonhosted.org/packages/a7/73/9f6602d6356bcf4c671f0d10999365cff6ebade197050f910d92f7501838/pymediainfo-6.0.1-py3-none-macosx_10_15_x86_64.whl ERROR: pymediainfo-6.0.1-py3-none-macosx_10_15_x86_64.whl is not a supported wheel on this platform.
I downloaded DyLib | v23.04 (https://mediaarea.net/download/binary/libmediainfo0/23.04/MediaInfo_DLL_23.04_Mac_x86_64+arm64.tar.bz2) but where should I place it and configure it?
Sorry in both cases I think I'm doing something wrong, can you be more detailed? Thank you

not use pip, just download it, rename it to zip, unzip and find the lib.

to the package dir where you install it.

https://stackoverflow.com/questions/31384639/what-is-pythons-site-packages-directory

thank you, perfect now is all ok!

@wuzhen810
Copy link

Hi, when launch my application with pymedia info I have this error:嗨,当使用 pymedia 信息启动我的应用程序时,我遇到此错误: OSError: Failed to load library from libmediainfo.0.dylib, libmediainfo.dylib - dlopen(libmediainfo.0.dylib, 0x0006): tried: 'libmediainfo.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibmediainfo.0.dylib' (no such file), '/usr/lib/libmediainfo.0.dylib' (no such file, not in dyld cache), 'libmediainfo.0.dylib' (no such file), '/usr/local/lib/libmediainfo.0.dylib' (no such file), '/usr/lib/libmediainfo.0.dylib' (no such file, not in dyld cache), dlopen(libmediainfo.dylib, 0x0006): tried: 'libmediainfo.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibmediainfo.dylib' (no such file), '/usr/lib/libmediainfo.dylib' (no such file, not in dyld cache), 'libmediainfo.dylib' (no such file), '/usr/local/lib/libmediainfo.dylib' (no such file), '/usr/lib/libmediainfo.dylib' (no such file, not in dyld cache)OSError:无法从libmediainfo.0.dylib加载库,libmediainfo.dylib - dlopen(libmediainfo.0.dylib, 0x0006): 尝试: 'libmediainfo.0.dylib' (没有这样的文件), '/System/Volumes/Preboot/Cryptexes/OSlibmediainfo.0.dylib' (没有这样的文件), '/usr/lib/libmediainfo.0.dylib' (没有这样的文件, 不在dyld cache中), 'libmediainfo.0.dylib' (没有这样的文件), '/usr/local/lib/libmediainfo.0.dylib' (没有这样的文件), '/usr/lib/libmediainfo.0.dylib' (没有这样的文件, 不在dyld cache中), dlopen(libmediainfo.dylib, 0x0006): 尝试: 'libmediainfo.dylib' (没有这样的文件), '/System/Volumes/Preboot/Cryptexes/OSlibmediainfo.dylib' (没有这样的文件), '/usr/lib/libmediainfo.dylib' (没有这样的文件, 不在 dyld 缓存中), 'libmediainfo.dylib' (没有这样的文件), '/usr/local/lib/libmediainfo.dylib' (没有这样的文件), '/usr/lib/libmediainfo.dylib' (没有这样的文件,不在 dyld 缓存中)
I have a problem with this library on my Mac arm m1/m2 mini.我的 Mac arm m1/m2 mini 上的这个库有问题。 Can I solve and fix this problem?我可以解决并解决此问题吗?

just copy a libmediainfo.dylib from here or the x86 mac pypi wheel to the package root directory. its a universal2 lib.

thank you~

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

4 participants