How to import torchdata?

I built and installed torchdata from source. Did anybody meet the same problem??

➜  ~ python
Python 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> import torchdata as td
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "~/.local/lib/python3.10/site-packages/torchdata/", line 9, in <module>
    from . import datapipes
  File "~/.local/lib/python3.10/site-packages/torchdata/datapipes/", line 9, in <module>
    from . import iter, map, utils
  File "~/.local/lib/python3.10/site-packages/torchdata/datapipes/iter/", line 32, in <module>
    from torchdata.datapipes.iter.load.aisio import (
  File "~/.local/lib/python3.10/site-packages/torchdata/datapipes/iter/load/", line 11, in <module>
    from torchdata.datapipes.utils import StreamWrapper
  File "~/.local/lib/python3.10/site-packages/torchdata/datapipes/utils/", line 9, in <module>
    from ._visualization import to_graph
  File "~/.local/lib/python3.10/site-packages/torchdata/datapipes/utils/", line 13, in <module>
    from import traverse_dps
ImportError: cannot import name 'traverse_dps' from '' (~/.local/lib/python3.10/site-packages/torch/utils/data/


Hi, if you are installing TorchData from source. Please install PyTorch nightly or from source as well. You can find the instruction to install nightly on our website’s main page.

I am using PyCharm IDE. You can easily download and install packages via its Python Packages tool window. I tried your code block and there is no error.