text icon indicating copy to clipboard operation
text copied to clipboard

[Cherry Pick] move PATH_MANAGER to OSS

Open Nayef211 opened this issue 3 years ago • 7 comments

Summary:

Problem:

pytext got "No module named 'pytorch'" in issue https://github.com/facebookresearch/pytext/issues/1706

It's due to from pytorch.text.fb.utils import PATH_MANAGER is internal only but imported in pytext. Actually, pytorch/text/fb/utils/__init__.py should be open sourced.

Solution:

This diff moved it to OSS as from torchtext.utils import PATH_MANAGER and updated all the references

Reviewed By: Nayef211

Differential Revision: D39292896

fbshipit-source-id: c0046d62e64145b60ad9a5298b366f0f1a348369

Nayef211 avatar Sep 15 '22 20:09 Nayef211

Looks like we need to include iopath in requirements.txt

hudeven avatar Sep 15 '22 20:09 hudeven

Is iopath fully available in OSS space?

There was an attempt to do this in the past, but reverted due to https://github.com/pytorch/text/issues/1380

mthrok avatar Sep 15 '22 23:09 mthrok

Is iopath fully available in OSS space?

There was an attempt to do this in the past, but reverted due to #1380

It seems like iopath is still only available from conda-forge and according to #1380, we don't want to have a dependency on that channel. @hudeven should we revert this diff altogether or are there any other alternatives we can pursue?

cc @seemethere

Nayef211 avatar Sep 16 '22 00:09 Nayef211

I see. I can revert it then.

hudeven avatar Sep 19 '22 23:09 hudeven

@Nayef211 I noticed that iopath is available in conda. The latest version is uploaded 1 year ago and likely to be outdated though: https://anaconda.org/iopath/iopath

hudeven avatar Sep 19 '22 23:09 hudeven

@Nayef211 I noticed that iopath is available in conda. The latest version is uploaded 1 year ago and likely to be outdated though: https://anaconda.org/iopath/iopath

Yup in https://github.com/pytorch/text/issues/1380#issuecomment-904121322 @seemethere mentions that we don't want a dependency on the conda-forge channel which is the only channel that iopath is available in. He might have more context as to why this is the case.

Nayef211 avatar Sep 19 '22 23:09 Nayef211

we don't want a dependency on the conda-forge channel

Dependency resolution is very complex and adding (requiring) conda-forge channel often makes it impossible to install PyTorch due to constrains posed by other libraries.

mthrok avatar Sep 20 '22 00:09 mthrok

@Nayef211 Can this be closed?

joecummings avatar Sep 27 '22 13:09 joecummings

@Nayef211 Can this be closed?

Yup the original diff was reverted

Nayef211 avatar Sep 27 '22 14:09 Nayef211