OSError: ~/.local/lib/python3.10/site-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: gsm_create

username: jiapei100
cooked: <p>Successfully built <strong>torchaudio</strong> but failed to load:</p>
<ol>
<li>
</li>
</ol>
<pre data-code-wrap="console"><code class="lang-nohighlight">➜  ~ pip show torchaudio
Name: torchaudio
Version: 0.14.0a0+17a2b93
Summary: An audio package for PyTorch
Home-page: https://github.com/pytorch/audio
Author: Soumith Chintala, David Pollack, Sean Naren, Peter Goldsborough
Author-email: soumith@pytorch.org
License: 
Location: ~/.local/lib/python3.10/site-packages
Requires: torch
Required-by:
</code></pre>
<ol start="2">
<li>
</li>
</ol>
<pre data-code-wrap="console"><code class="lang-nohighlight">➜  ~ python
Python 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import torch
&gt;&gt;&gt; import torchaudio as ta
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "~/.local/lib/python3.10/site-packages/torchaudio/__init__.py", line 1, in &lt;module&gt;
    from torchaudio import (  # noqa: F401
  File "~/.local/lib/python3.10/site-packages/torchaudio/_extension.py", line 135, in &lt;module&gt;
    _init_extension()
  File "~/.local/lib/python3.10/site-packages/torchaudio/_extension.py", line 105, in _init_extension
    _load_lib("libtorchaudio")
  File "~/.local/lib/python3.10/site-packages/torchaudio/_extension.py", line 52, in _load_lib
    torch.ops.load_library(path)
  File "~/.local/lib/python3.10/site-packages/torch/_ops.py", line 573, in load_library
    ctypes.CDLL(path)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: ~/.local/lib/python3.10/site-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: gsm_create
</code></pre>
<ol start="3">
<li>Similar thing happened to <strong>torchtext</strong>:</li>
</ol>
<pre data-code-wrap="console"><code class="lang-nohighlight">➜  ~ pip show torchtext 
Name: torchtext
Version: 0.14.0a0+3f9c349
Summary: Text utilities and datasets for PyTorch
Home-page: https://github.com/pytorch/text
Author: PyTorch core devs and James Bradbury
Author-email: jekbradbury@gmail.com
License: BSD
Location: ~/.local/lib/python3.10/site-packages
Requires: numpy, requests, torch, tqdm
Required-by: 
</code></pre>
<pre data-code-wrap="console"><code class="lang-nohighlight">&gt;&gt;&gt; import torchtext as tt
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "~/.local/lib/python3.10/site-packages/torchtext/__init__.py", line 6, in &lt;module&gt;
    from torchtext import _extension  # noqa: F401
  File "~/.local/lib/python3.10/site-packages/torchtext/_extension.py", line 64, in &lt;module&gt;
    _init_extension()
  File "~/.local/lib/python3.10/site-packages/torchtext/_extension.py", line 58, in _init_extension
    _load_lib("libtorchtext")
  File "~/.local/lib/python3.10/site-packages/torchtext/_extension.py", line 50, in _load_lib
    torch.ops.load_library(path)
  File "~/.local/lib/python3.10/site-packages/torch/_ops.py", line 573, in load_library
    ctypes.CDLL(path)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: ~/.local/lib/python3.10/site-packages/torchtext/lib/libtorchtext.so: undefined symbol: _ZTVN5torch8autograd12AutogradMetaE
</code></pre>
<p>Any suggestions please?</p>
<p>Thank you</p>

username: mostafa_alaviyan
cooked: <p><a class="mention" href="/u/jiapei100">@jiapei100</a><br>
hello<br>
I encountered with the same error, can U solve it?</p>

username: nateanl
cooked: <p>This issue may help <a href="https://github.com/pytorch/audio/issues/2614" class="inline-onebox" rel="noopener nofollow ugc">Encountered undefined symbol: gsm_create when import torchaudio · Issue #2614 · pytorch/audio · GitHub</a></p>