Skip to content

[BUG] No module named 'expecttest' when import torchao #222

Closed
@gau-nernst

Description

@gau-nernst

To reproduce, install torchao from main, then import torchao

pip install git+https://github.com/pytorch/ao
python -c "import torchao"

Error

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 import torchao

File ~/code/ao/torchao/__init__.py:8
      6 from . import dtypes
      7 import torch
----> 8 from torch.testing._internal.common_utils import IS_FBCODE
      9 if not IS_FBCODE:
     10     from . import _C

File ~/miniconda3/envs/dev2.3/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py:62
     47 from typing import (
     48     Any,
     49     Callable,
   (...)
     58     Union,
     59 )
     60 from unittest.mock import MagicMock
---> 62 import expecttest
     63 import numpy as np
     65 import __main__  # type: ignore[import]

ModuleNotFoundError: No module named 'expecttest'

The problem is self-explanatory. 2 possible solutions:

  • Add expecttest to requirements.txt
  • Add a try-except clause

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions