pytorch/text

torchtext main branch doesn't support pytorch2.0

Open

#2,052 opened on Feb 10, 2023

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Python (3,396 stars) (822 forks)batch import
good first issue

Description

Hi,

I want to build torchtext from source by using 'python setup.py clean install'. the version of pytorch I used is 2.0.0. But it report the following error:

Installed /home/yangqun/miniconda3/envs/pt/lib/python3.8/site-packages/torchtext-0.15.0a0+9db75ab-py3.8-linux-x86_64.egg
Processing dependencies for torchtext==0.15.0a0+9db75ab
error: torch 2.0.0a0+git13b3d86 is installed but torch==1.13.1 is required by {'torchdata'}

When I try to import torchtext, the following error is reported;

>>> import torch
>>> import torchtext
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/yangqun/text/torchtext/__init__.py", line 6, in <module>
    from torchtext import _extension  # noqa: F401
  File "/home/yangqun/text/torchtext/_extension.py", line 64, in <module>
    _init_extension()
  File "/home/yangqun/text/torchtext/_extension.py", line 56, in _init_extension
    raise ImportError("torchtext C++ Extension is not found.")
ImportError: torchtext C++ Extension is not found.

Could anyone point me how can I use torchtext with torch 2.0.0 ?

Contributor guide