text
text copied to clipboard
import torchtext fails
🐛 Bug
Today I installed torchtext in my Linux Ubuntu. When I tried to import torchtext into python, torchtext failed.
Details
-
Ubuntu 24.04.1 LTS
-
Python 3.12.3
-
PyTorch Version 2.5.1+cu124 (running fine)
-
During the torchtext install I saw messages suggesting that the version is 0.18, which according to what I read, is the last one to be supported.
-
The error messages I get when I issue the command "import torchtex" are below.
-
QUESTION: Given that torchtext will not be supported any more, is there an alternative API for text processing in PyTorch that will take the role of torchtext?
import torchtext
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/drv3/hm3/code/python/torch/lib/python3.12/site-packages/torchtext/__init__.py", line 18, in <module>
from torchtext import _extension # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/drv3/hm3/code/python/torch/lib/python3.12/site-packages/torchtext/_extension.py", line 64, in <module>
_init_extension()
File "/drv3/hm3/code/python/torch/lib/python3.12/site-packages/torchtext/_extension.py", line 58, in _init_extension
_load_lib("libtorchtext")
File "/drv3/hm3/code/python/torch/lib/python3.12/site-packages/torchtext/_extension.py", line 50, in _load_lib
torch.ops.load_library(path)
File "/drv3/hm3/code/python/torch/lib/python3.12/site-packages/torch/_ops.py", line 1350, in load_library
ctypes.CDLL(path)
File "/usr/lib/python3.12/ctypes/__init__.py", line 379, in __init__
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^