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

Install problem on M1 #1321

Closed
PierreVannier opened this issue Apr 10, 2023 · 9 comments
Closed

Install problem on M1 #1321

PierreVannier opened this issue Apr 10, 2023 · 9 comments
Labels

Comments

@PierreVannier
Copy link

Hi,

It seems this error is related to #1306.
I'm running an M1 pro with the following
pip list =>
pyannote.audio 2.1.1
pyannote.core 4.5
pyannote.database 4.1.3
pyannote.metrics 3.2.1
pyannote.pipeline 2.3
torch 2.0.0

python --version
Python 3.10.10
pip install pyannote-audio
$python
Python 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:12:31) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyannote.audio import Pipeline
/Users/pierrevannier/miniforge3/lib/python3.10/site-packages/torchaudio/_internal/module_utils.py:99: UserWarning: Failed to import soundfile. 'soundfile' backend is not available.
  warnings.warn("Failed to import soundfile. 'soundfile' backend is not available.")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/pierrevannier/miniforge3/lib/python3.10/site-packages/pyannote/audio/__init__.py", line 29, in <module>
    from .core.inference import Inference
  File "/Users/pierrevannier/miniforge3/lib/python3.10/site-packages/pyannote/audio/core/inference.py", line 34, in <module>
    from pyannote.audio.core.io import AudioFile
  File "/Users/pierrevannier/miniforge3/lib/python3.10/site-packages/pyannote/audio/core/io.py", line 38, in <module>
    import torchaudio
  File "/Users/pierrevannier/miniforge3/lib/python3.10/site-packages/torchaudio/__init__.py", line 1, in <module>
    from torchaudio import (  # noqa: F401
  File "/Users/pierrevannier/miniforge3/lib/python3.10/site-packages/torchaudio/_extension.py", line 135, in <module>
    _init_extension()
  File "/Users/pierrevannier/miniforge3/lib/python3.10/site-packages/torchaudio/_extension.py", line 105, in _init_extension
    _load_lib("libtorchaudio")
  File "/Users/pierrevannier/miniforge3/lib/python3.10/site-packages/torchaudio/_extension.py", line 52, in _load_lib
    torch.ops.load_library(path)
  File "/Users/pierrevannier/miniforge3/lib/python3.10/site-packages/torch/_ops.py", line 643, in load_library
    ctypes.CDLL(path)
  File "/Users/pierrevannier/miniforge3/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/pierrevannier/miniforge3/lib/python3.10/site-packages/torchaudio/lib/libtorchaudio.so, 0x0006): Symbol not found: __ZN2at4_ops9_pad_enum4callERKNS_6TensorEN3c108ArrayRefIxEExNS5_8optionalIdEE
  Referenced from: <BE6EA463-573E-3D7C-9087-E19500344FCD> /Users/pierrevannier/miniforge3/lib/python3.10/site-packages/torchaudio/lib/libtorchaudio.so
  Expected in:     <78DA4C67-8BC7-3995-8324-D2FD95E57BA4> /Users/pierrevannier/miniforge3/lib/python3.10/site-packages/torch/lib/libtorch_cpu.dylib
@github-actions
Copy link

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@chainyo
Copy link

chainyo commented Apr 11, 2023

Hi, @PierreVannier I'm facing the same problem using Poetry and Python 3.10.* on an M1 Mac.

Until it's fully compatible, I would stick to Python 3.9 and Torch 1.13. Because pyannote.audio has a strict version constraint: torchaudio >=0.10,<1.0

@PierreVannier
Copy link
Author

Hi, @PierreVannier I'm facing the same problem using Poetry and Python 3.10.* on an M1 Mac.

Until it's fully compatible, I would stick to Python 3.9 and Torch 1.13. Because pyannote.audio has a strict version constraint: torchaudio >=0.10,<1.0

Thanks @chainyo ! I got many troubles on M1 install (even with strict torch version check), it’s causing errors when importing pipelines (after a correct install). Also hmmlearn isn’t installing properly…
I guesse M1 isn’t the way to go for this module 😔

@mrmachine
Copy link

@PierreVannier On M1, I had problems with torch>=2 and hmmlearn. I was able to get my project running by changing the requirements to install torch<2 (thanks to @chainyo above) and hmmlearn main branch from git:

-e git+https://github.com/hmmlearn/hmmlearn.git#egg=hmmlearn

See: hmmlearn/hmmlearn#514 (comment)

@monaqa
Copy link

monaqa commented Apr 24, 2023

Package hmmlearn 0.3.0 has been released, which will solve the issue about installing on M1 Mac.
However, pyannote-audio 2.1.1 seems to require hmmlearn < 0.3, so installing pyannote-audio still does not work.
Why not loosen the version constraints?

https://github.com/pyannote/pyannote-audio/blob/master/requirements.txt#L4

Farissoliman added a commit to Farissoliman/pyannote-audio that referenced this issue Jul 5, 2023
Updated install requirements for hmmlearn to allow it to be used for Mac M1 devices and make it compatible with the new hmmlearn 0.3.0. It should fix problem pyannote#1321
@cwazuidema
Copy link

I can confirm that this fix works on M1 Pro. My issue was with hmmlearn as well.

@martinjurkovic
Copy link

martinjurkovic commented Jul 30, 2023

Since the pull request is still not closed I was able to install pyannote.audio with pip install -c constraints.txt pyannote.audio, where I put hmmlearn>=0.3.0 in the constraints.txt.

@tomklaverpon
Copy link

Thanks Farissoliman, this fixed the issue (also for M2 chips). For those using poetry:

pyannote-audio = {git = "https://github.com/Farissoliman/pyannote-audio.git", rev = "patch-1"}

Copy link

stale bot commented Feb 19, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Feb 19, 2024
@stale stale bot closed this as completed Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants