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

import torchtext fails #2283

Open
JuanVargas opened this issue Feb 3, 2025 · 0 comments
Open

import torchtext fails #2283

JuanVargas opened this issue Feb 3, 2025 · 0 comments

Comments

@JuanVargas
Copy link

🐛 Bug

Today I installed torchtext in my Linux Ubuntu. When I tried to import torchtext into python, torchtext failed.

Details

  1. Ubuntu 24.04.1 LTS

  2. Python 3.12.3

  3. PyTorch Version 2.5.1+cu124 (running fine)

  4. 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.

  5. The error messages I get when I issue the command "import torchtex" are below.

  6. 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)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant