Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

No module named 'pytorch' #1706

@anjali-chadha

Description

@anjali-chadha

Steps to reproduce

Installed both torch and torchtext from the source code

  • Torch version: '1.9.0a0+git854cc53'

  • TorchText version: '0.11.0a0+05cb992'

  • Install pytext from source

cd /tmp 
git clone https://github.com/facebookresearch/pytext.git
cd pytext
sudo python3 setup.py install
  • Import pytext
import pytext

Observed Results

  • What happened? This could be a description, log output, etc.
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-0d876a9b1d3f> in <module>
----> 1 import pytext

/usr/local/lib/python3.6/dist-packages/pytext_nlp-0.3.3-py3.6.egg/pytext/__init__.py in <module>
    10 from caffe2.python import workspace
    11 from caffe2.python.predictor import predictor_exporter
---> 12 from pytext.data.sources.data_source import DataSource
    13 from pytext.task import load
    14 from pytext.task.new_task import NewTask

/usr/local/lib/python3.6/dist-packages/pytext_nlp-0.3.3-py3.6.egg/pytext/data/__init__.py in <module>
    10     NaturalBatchSampler,
    11 )
---> 12 from .data import Batcher, Data, PoolingBatcher, generator_iterator
    13 from .data_handler import BatchIterator, CommonMetadata, DataHandler
    14 from .disjoint_multitask_data import DisjointMultitaskData

/usr/local/lib/python3.6/dist-packages/pytext_nlp-0.3.3-py3.6.egg/pytext/data/data.py in <module>
    12 from pytext.utils.usage import log_class_usage
    13 
---> 14 from .sources import DataSource, RawExample, TSVDataSource
    15 from .sources.data_source import (
    16     GeneratorIterator,

/usr/local/lib/python3.6/dist-packages/pytext_nlp-0.3.3-py3.6.egg/pytext/data/sources/__init__.py in <module>
     2 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
     3 
----> 4 from .conllu import CoNLLUNERDataSource
     5 from .data_source import DataSource, RawExample
     6 from .dense_retrieval import DenseRetrievalDataSource

/usr/local/lib/python3.6/dist-packages/pytext_nlp-0.3.3-py3.6.egg/pytext/data/sources/conllu.py in <module>
     5 from typing import Dict, List, Optional, Type
     6 
----> 7 from pytext.data.sources.data_source import RootDataSource, SafeFileWrapper
     8 
     9 

/usr/local/lib/python3.6/dist-packages/pytext_nlp-0.3.3-py3.6.egg/pytext/data/sources/data_source.py in <module>
    10 from pytext.data.utils import shard
    11 from pytext.utils.data import Slot, parse_slot_string
---> 12 from pytext.utils.file_io import PathManager
    13 
    14 

/usr/local/lib/python3.6/dist-packages/pytext_nlp-0.3.3-py3.6.egg/pytext/utils/file_io.py in <module>
    10 # TODO: @stevenliu use PathManagerFactory after it's released to PyPI
    11 from iopath.common.file_io import HTTPURLHandler
---> 12 from pytorch.text.fb.utils import PATH_MANAGER as PathManager  # noqa
    13 
    14 

ModuleNotFoundError: No module named 'pytorch'

Expected Results

  • What did you expect to happen?
    No errors while importing pytext

Module causing this error pytorch.text.fb.utils is not mentioned in the requirements.txt. Is this an internal module to FB?
Any recommendation to circumvent this error?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions