Repository: pykeen/pykeen
Issue: ImportError: cannot import name 'ScorePack' from 'pykeen.typing'
Root cause: Documentation Deficiency

### Describe the bug

I created a pipeline and wanted to execute `get_tail_prediction_df` . That is when I got the ImportError. When querying the pykeen version, I also get an import error. According to pip freeze, I have version 1.10.0

### How to reproduce

```python
result = pipeline(
            dataset='Nations',
            model=pk.models.unimodal.auto_sf.AutoSF,
            loss=pk.losses.BCEAfterSigmoidLoss,
            #regularizer=self.regularizer,
            optimizer=torch.optim.Adadelta,
            lr_scheduler=torch.optim.lr_scheduler.ConstantLR,
            negative_sampler=pk.sampling.bernoulli_negative_sampler.BernoulliNegativeSampler,
            random_seed=42
        )

from pykeen.models.predict import get_tail_prediction_df

df = get_tail_prediction_df(
    model=result.model,
    head_label="belgium",
    relation_label="locatedin",
    triples_factory=result.training,
    add_novelties=False,
)
 
```

```python-traceback
Traceback (most recent call last):
  File "/home/larissa/anaconda3/envs/pykeen/lib/python3.10/runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/home/larissa/anaconda3/envs/pykeen/lib/python3.10/runpy.py", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/home/larissa/anaconda3/envs/pykeen/lib/python3.10/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/home/larissa/anaconda3/envs/pykeen/lib/python3.10/site-packages/pykeen/__init__.py", line 35, in <module>
    from .version import env, get_git_branch, get_git_hash, get_version  # noqa: F401
  File "/home/larissa/anaconda3/envs/pykeen/lib/python3.10/site-packages/pykeen/version.py", line 9, in <module>
    from typing import Optional, Tuple
  File "/home/larissa/anaconda3/envs/pykeen/lib/python3.10/site-packages/pykeen/typing.py", line 5, in <module>
    from typing import Callable, Collection, Literal, Mapping, NamedTuple, Sequence, Tuple, TypeVar, Union, cast
ImportError: cannot import name 'Callable' from partially initialized module 'typing' (most likely due to a circular import) (/home/larissa/anaconda3/envs/pykeen/lib/python3.10/site-packages/pykeen/typing.py)
```

### Environment

### Additional information

_No response_

### Issue Template Checks

- [X] This is not a feature request (use a different issue template if it is)
- [X] This is not a question (use the [discussions](https://github.com/pykeen/pykeen/discussions/new) forum instead)
- [X] I've read the text explaining why including environment information is important and understand if I omit this information that my issue will be dismissed

Hi @LizzAlice, can you please copy the output of running `python -m pykeen version`?

Also, this might happen if you have created the python file you're trying to run inside the package itself

Hi, the output of that command is another error, the one I pasted into the corresponding field.
I did not do that, I created the file in another directory.
When looking at the file typing.py, there is no ScorePack. Is it possible that it got deleted?

Sorry, I am confused, there's no mention of `ScorePack` in the error message. So the error you posted is what happened when you ran `python -m pykeen version` but you didn't post the error message from the code you read?

The error message from the code is contained in the title, it is: ImportError: cannot import name 'ScorePack' from 'pykeen.typing'
The traceback is

```python-traceback
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[24], line 1
----> 1 from pykeen.models.predict import get_tail_prediction_df
      3 df = get_tail_prediction_df(
      4     model=result.model,
      5     head_label="belgium",
   (...)
      8     add_novelties=False,
      9 )

File ~/anaconda3/envs/pykeen/lib/python3.10/site-packages/pykeen/models/predict.py:21
     19 from ..triples import CoreTriplesFactory, TriplesFactory
     20 from ..triples.utils import tensor_to_df
---> 21 from ..typing import (
     22     LABEL_HEAD,
     23     LABEL_RELATION,
     24     LABEL_TAIL,
     25     InductiveMode,
     26     LabeledTriples,
     27     MappedTriples,
     28     ScorePack,
     29     Target,
     30 )
     31 from ..utils import is_cuda_oom_error
     33 __all__ = [
     34     "predict",
     35     "predict_triples_df",
   (...)
     41     "get_tail_prediction_df",
     42 ]

ImportError: cannot import name 'ScorePack' from 'pykeen.typing' (/home/larissa/anaconda3/envs/pykeen/lib/python3.10/site-packages/pykeen/typing.py)
```

This time, I used code from the documentation to reproduce the error:
```python
from pykeen.datasets import get_dataset
from pykeen.pipeline import pipeline
dataset = get_dataset(dataset="countries")
result = pipeline(dataset=dataset, model="mure")

from pykeen.models.predict import get_tail_prediction_df

df = get_tail_prediction_df(
    model=result.model,
    head_label="belgium",
    relation_label="locatedin",
    triples_factory=result.training,
    add_novelties=False,
)

```

Hi @LizzAlice ,

> `File ~/anaconda3/envs/pykeen/lib/python3.10/site-packages/pykeen/models/predict.py:21`

there is no file `pykeen/models/predict.py` in the [`v1.10`](https://github.com/pykeen/pykeen/tree/v1.10.0/src/pykeen/models) release. Maybe you have an unclean installation? Could you try to force a re-install and see whether this resolves your issue?

```console
pip install --upgrade --force-reinstall pykeen
```

Update: It seems we did not properly update the documentation in https://github.com/pykeen/pykeen/pull/1090, which still points to `pykeen.models.predict` while the module now lives under `pykeen.predict`.

I reinstalled pykeen.
So to be clear, I should now do `from pykeen.predict import get_tail_prediction_df`?
Because when I try that, I get
``` 
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[7], line 1
----> 1 from pykeen.predict import get_tail_prediction_df
      3 df = get_tail_prediction_df(
      4     model=result.model,
      5     head_label="belgium",
   (...)
      8     add_novelties=False,
      9 )

ImportError: cannot import name 'get_tail_prediction_df' from 'pykeen.predict' (/home/larissa/anaconda3/envs/pykeen/lib/python3.10/site-packages/pykeen/predict.py)


```

At least, reinstalling fixed the version problem.
```
<frozen importlib._bootstrap>:241: RuntimeWarning: scipy._lib.messagestream.MessageStream size changed, may indicate binary incompatibility. Expected 56 from C header, got 64 from PyObject
| Key             | Value                    |
|-----------------|--------------------------|
| OS              | posix                    |
| Platform        | Linux                    |
| Release         | 5.15.0-60-generic        |
| Time            | Wed Feb 15 09:39:12 2023 |
| Python          | 3.10.9                   |
| PyKEEN          | 1.10.0                   |
| PyKEEN Hash     | UNHASHED                 |
| PyKEEN Branch   |                          |
| PyTorch         | 1.13.1+cu117             |
| CUDA Available? | true                     |
| CUDA Version    | 11.7                     |
| cuDNN Version   | 8500                     |

```

> So to be clear, I should now do from `pykeen.predict import get_tail_prediction_df`?

We have a migration guide at https://pykeen.readthedocs.io/en/stable/reference/predict.html#migration-guide. `get_tail_prediction_df` was already deprecated in v1.9 in favour of directly using `get_prediction_df`, though it might make sense to explicitly add those conversions to the documentation, too!

For your example, you would want to use `predict_target`
```python
df = predict_target(
    model=result.model,
    head="belgium",
    relation="locatedin",
    triples_factory=result.training,
).df
```
Notice that there is a trailing `.df`, since the direct return value of `predict_target` is a `Predictions` object which offers some additional utilities (e.g., filtering of results).

An up-to-date description of how to use the prediction workflow(s) can be found at https://pykeen.readthedocs.io/en/stable/reference/predict.html

The migration guide has been updated to give better information how to migrate from `get_tail_prediction_df` in https://github.com/pykeen/pykeen/pull/1233 . I'll close this issue, but feel free to re-open if you think there is something missing.