Error importing Torchaudio

Hi all,

I can’t import Torchaudio, this is my setup:

  • macOS Monterey 12.4 (Intel Mac)
  • Python 3.10.4 (virtual env, Python has been installed with the installer from the website, no Conda or similar)
  • Torch 1.11.0 (installed with Pip)
  • TorchAudio 0.11.0 (installed with Pip)

This is the error I get when I try to import Torchaudio with “import torchaudio”:

OSError: dlopen(/Users/ ... path to my env ... /ap_venv/lib/python3.10/site-packages/torchaudio/lib/libtorchaudio.so, 0x0006): Symbol not found: __ZN2at8internal15invoke_parallelExxxRKNSt3__18functionIFvxxEEE
  Referenced from: /Users/... path to my env ... /ap_venv/lib/python3.10/site-packages/torchaudio/lib/libtorchaudio.so
  Expected in: /Users/ ... path to my env ... /ap_venv/lib/python3.10/site-packages/torch/lib/libtorch_cpu.dylib

(I’ve removed from the error the part of the path that contains personal information)

I’ve checked and the file “libtorch_cpu.dylib” is at the path specified in the error. I’ve tried to install and import Torchaudio also in the main Python installation (so not in a virtual env) and the error is the same (of course the path is different).

Torch alone works without issues, only Torchaudio raise this error.

What can I do? Thank you for your support.

I am also struggling with this same exact issue (same pytorch version) did you find a solution?

I faced with the same problem. Change python in venv from 3.10 to latest 3.8.10 works for me.

With pyenv:

pyenv install 3.8.10
~/.pyenv/versions/3.8.10/bin/python -m venv venv_name

I am also experiencing this issue, but i do not have the option of downgrading python to 3.8, anybody have a solution for 3.10?

I am still experiencing this issue… Anybody have any insights?