-
Notifications
You must be signed in to change notification settings - Fork 111
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
Apple M1 installation and usage #310
Comments
Turns out the fix is, copy the dylib installed from Homebrew into the expected directory and it picks it up. So, my assumption is that this just a packaging issue. I could open a PR if you can tell me how you usually solve those issues. |
I guess we'll need a new dylib for M1. I am still waiting for the next release of libsndfile, which will include MP3 support. Once that is available, I'll rebuild libsndfile for all platforms, and will try to include an M1 version if that's possible from an Intel Mac (I don't have M1 hardware). But really, the source version of soundfile should just pick up any Homebrew-installed libsndfile. Do you know why it didn't do that in your case? Probably either a library search path issue, or a file naming issue that we could easily fix as an interim solution. |
The problem is that Latest releases of MacOS no longer seem to honor Homebrew which is the de facto installer on MacOS uses So it's sort of an impasse. We either need to:
That is, until a new release is made, so we can just include |
Well, that is troubling. Do you know how other libraries are handling this? I wouldn't mind having a workaround specific for M1 in python-soundfile, at least until this situation is resolved. Would you like to create a pull request? |
I've opened PR #311. It seems to resolve things until the next build of libsndfile were we can have the actual library included in the distribution of |
Thank you very much for your contribution! I'll try to release a bugfix release for this in the next few days. |
Any news on this release? I'd really like to use this package on my M1 machine 😬 |
I hope I'll find time to do the release this week. I'd like to include the related changes in #322 as well. |
I have started working on the release. Man, it's been a while since I've used a Mac, and I've forgotten just how annoying the command line experience is on there. Right now it's stuck installing homebrew (did this always take so long?), because the included curl is woefully out-of-date and can't even download files any more... At any rate, I would like to ship binary wheels that include M1 support, but the only Mac I have access to is an older Intel machine. If anyone could provide me with a recently-compiled version of libsndfile in https://github.com/bastibe/libsndfile-binaries/, I'd love to include them in the wheel! There's a build-script for macOS included in the repository that should work out of the box (just update the version numbers at the top to the most recent ones). Hopefully. |
I can do that, let me know how I can ship you the binaries. |
Brilliant, thank you! Open a pull request on https://github.com/bastibe/libsndfile-binaries with the new library, and I'll happily merge it! I don't know about *.dylib conventions. It might be possible to have a universal libsndfile.dylib that works on Intel and ARM, or it might be necessary to ship two separate dylibs (like for Windows). As of five minutes ago, the build script for macOS should be up-to-date, and worked fine on Intel Big Sur machine. |
I'm afraid that's about all I can do this week. My FOSS-time is now pretty much used up. I'll try to continue next week, and hopefully build a beta version at least. Once that is confirmed working, I'll push it to PyPi. python-soundfile has become too big to rush it onto PyPi without testing on all systems. Thank you everyone for your patience, and your contributions! |
I just opened a PR here, hope it helps! |
Thank you so very much @chuma9615! I'll have a look later this week, when I continue work on this. |
I'll continue the discussion on creating a new release in #325. Any help would be greatly appreciated! It's been a while since we last built a release for soundfile. |
Quick workaround for everybody. Add: to your |
Just so you know, this is dangerous advice. It forces all shell-executed software to link preferentially against homebrew libraries. If you must use DYLD_LIBRARY_PATH, do it in a per-execution basis, e.g. |
True, but I suspect it for 90% of the users as safe :-) |
I emphatically do not! In fact I have run into problems with |
Maybe true for Linux but on Mac 90% of the libs go through hombrew anyways. |
Hello, is there any update on this issue? I still get the '_soundfile_data/libsndfile.dylib' ' no such file error, as mentioned initially by @panosl . Surprisingly, creating a directory named '_soundfile_data' into the miniforge3 'site_packages' dir doesn't work either. |
It worked on my M1 Mac with this comment. thx. |
The upcoming release should fix this issue, by bundling an appropriate version of libsndfile with the soundfile wheel. |
When this is coming? |
v0.11.0 has been released a few days ago |
I installed soundfile v0.11.0 and I still ran into the same problem (in a conda env running on Mac M1) |
Then conda is probably delivering the wrong package. |
I did |
You probably have another, system-installed libsndfile. Soundfile always tries your system-installed libraries before it loads its own. |
I'm having trouble using soundfile in miniconda3 on m1 mac. soundfile seems to have trouble finding the dylib file:
The reason is probably that the dylib file is named WorkaroundThe current workaround is to make a copy of |
Don't use conda. They break things frequently for many users, and there's nothing we developers can do about it. Conda used to be useful back when wheels weren't yet available everywhere. But no longer. Soundfile is published on PyPi as a wheel. Install that, and you'll be good. |
Ok, I see. Python package management/dependency resolution seems like quite a mess to me. I'm only using conda because tensorflow needs to be installed through conda on M1 macs to have GPU support. Otherwise, I would be happy to stick with PyPi. |
You can mix and match. Install only what you must with conda, and get what you can from PyPi. |
Executing
pip install SoundFile
on an M1, installs just fine using generic wheel:But trying to import soundfile shows the libsndfile as missing:
Installing the
libsndfile
through brew, is not picked up either.The text was updated successfully, but these errors were encountered: