Repository: Unbabel/COMET
Issue: TypeError: 'type' object is not subscriptable
Root cause: External Dependency Breakage

## 🐛 Bug

After installation, whether via `pip`, `poetry`, or direct usage (`./comet/cli/score.py`), I get the following error:

```bash
$ PYTHONPATH=. python3 ./comet/cli/score.py
Traceback (most recent call last):
  File "./comet/cli/score.py", line 56, in <module>
    from comet.download_utils import download_model
  File "/home/mattpost/src/COMET/comet/__init__.py", line 19, in <module>
    from .download_utils import download_model
  File "/home/mattpost/src/COMET/comet/download_utils.py", line 26, in <module>
    from comet.models import available_metrics
  File "/home/mattpost/src/COMET/comet/models/__init__.py", line 17, in <module>
    from .regression.regression_metric import RegressionMetric
  File "/home/mattpost/src/COMET/comet/models/regression/regression_metric.py", line 26, in <module>
    from comet.models.base import CometModel
  File "/home/mattpost/src/COMET/comet/models/base.py", line 41, in <module>
    class OrderedSampler(Sampler[int]):
TypeError: 'type' object is not subscriptable
```

This is with Python 3.8.10, so relatively recent.

### Environment
OS: Linux (ubuntu 20.04.3)
Packaging: all
Version: 1.0.1 (latest source)

Looks like I need `torch >= 1.4`. Somehow `poetry install` didn't pick up on this, or I have a venv problem. Maybe it should be added to `requirements.txt`?

Hi @mjpost,

I install unbabel-comet in a Python venv 3.7.12. I am also experiencing the same issue:

```Traceback (most recent call last):
Traceback (most recent call last):
  File "/home/ubuntu/unbabel-comet-1.0.1/venv/bin/comet-score", line 5, in <module>
    from comet.cli.score import score_command
  File "/home/ubuntu/unbabel-comet-1.0.1/venv/lib/python3.7/site-packages/comet/__init__.py", line 19, in <module>
    from .download_utils import download_model
  File "/home/ubuntu/unbabel-comet-1.0.1/venv/lib/python3.7/site-packages/comet/download_utils.py", line 26, in <module>
    from comet.models import available_metrics
  File "/home/ubuntu/unbabel-comet-1.0.1/venv/lib/python3.7/site-packages/comet/models/__init__.py", line 17, in <module>
    from .regression.regression_metric import RegressionMetric
  File "/home/ubuntu/unbabel-comet-1.0.1/venv/lib/python3.7/site-packages/comet/models/regression/regression_metric.py", line 26, in <module>
    from comet.models.base import CometModel
  File "/home/ubuntu/unbabel-comet-1.0.1/venv/lib/python3.7/site-packages/comet/models/base.py", line 41, in <module>
    class OrderedSampler(Sampler[int]):
TypeError: 'type' object is not subscriptable
```

when I call ` comet-score`. I installed torch version 1.4.0, however the problem still persists.

Would you know how to fix this?

Thank you for your help.

I ended up with `torch` version 1.10.0. I suggest you double-check that `comet-score` isn't linking to an old version, maybe installed elsewhere. I think I solved my problems after running `pip uninstall` both as the regular user and root, and then reinstalling.

I just ran into this again today. There were two problems: first, comet 1.0.1 was installed in `~/.local/bin`, and comet 0.1.0 in the system bin directory. I had to do `pip uninstall unbabel-comet` as both my regular user and root. Then, I got the error with pytorch 1.6.0. After upgrading to 1.10.2, all is well.

Yes, with torch version 1.10.0, it works very well. Would this mean that the requirements for the package should be adjusted?

I would think so. You might try submitting a PR referencing this issue.