parlance / ctcdecode

PyTorch CTC Decoder bindings
MIT License
829 stars 243 forks source link

"Symbol not found in flat name space" in MacOS (macbook pro M1) when importing ctcdecode #208

Open JoseEliel opened 2 years ago

JoseEliel commented 2 years ago

Hi! I've been on a somewhat problematic path of trying to install ctcdecode on MacOS with an M1 MacBook pro. I had to use GCC 12 instead of clang for the installation to work at all. After pip seems to install ctcdecode, importing it results in the error:

ImportError: dlopen(/opt/homebrew/Caskroom/miniforge/base/envs/rusocr/lib/python3.8/site-packages/ctcdecode/_ext/ctc_decode.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '__ZN3c1010TensorImpl17set_autograd_metaESt10unique_ptrINS_21AutogradMetaInterfaceESt14default_deleteIS2_EE'

I have torch, torchvision and torchaudio installed, and I've tried importing torch before importing ctcdecode to no avail. I tried installing torch from source, but pip can't find the package when I give the no binary option.

JoseEliel commented 2 years ago

Full Error output for reference:

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/homebrew/Caskroom/miniforge/base/envs/rusocr/lib/python3.8/site-packages/ctcdecode/__init__.py", line 3, in <module> from ._ext import ctc_decode ImportError: dlopen(/opt/homebrew/Caskroom/miniforge/base/envs/rusocr/lib/python3.8/site-packages/ctcdecode/_ext/ctc_decode.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '__ZN3c1010TensorImpl17set_autograd_metaESt10unique_ptrINS_21AutogradMetaInterfaceESt14default_deleteIS2_EE'