I have PyTorch installed in my machine but whenever I try to do the following-
from torchtext import data
from torchtext import datasets
I get the following error.
ImportError: No module named 'torchtext'
How can I install torchtext?
As stated in the PyTorch forum, simply do:
$ pip install https://github.com/pytorch/text/archive/master.zip
That should do it.
If not, as an alternative, try:
$ pip install torchtext
For more advanced options, dependencies, and customized installations see:
The package was released with setuptools support. You can clone the repository and run python setup.py install. Unfortunately, I don't think that they have released it on pip.