Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I install torchtext?

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?

like image 422
Wasi Ahmad Avatar asked Mar 10 '17 05:03

Wasi Ahmad


People also ask

Is Torchtext part of PyTorch?

This library is part of the PyTorch project. PyTorch is an open source machine learning framework.


2 Answers

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:

pypi.org/project/torchtext

like image 152
kmario23 Avatar answered Sep 24 '22 09:09

kmario23


Try

pip install torchtext

For more details on installation please read pytorch github

like image 35
Abhishek K Avatar answered Sep 25 '22 09:09

Abhishek K