AttributeError: module 'dill' has no attribute 'extend'
I have just installed Pytorch, using:
(base) C:\&gt;pip3 install torch torchvision torchaudio
Requirement already satisfied: torch in c:\users\Emil\appdata\roaming\python\python38\site-packages (1.9.0)
Requirement already satisfied: torchvision in c:\users\Emil\appdata\roaming\python\python38\site-packages (0.10.0)
Requirement already satisfied: torchaudio in c:\users\Emil\anaconda3\lib\site-packages (0.12.1)
Requirement already satisfied: typing-extensions in c:\users\Emil\anaconda3\lib\site-packages (from torch) (3.7.4.3)
Requirement already satisfied: numpy in c:\users\Emil\anaconda3\lib\site-packages (from torchvision) (1.22.2)
Requirement already satisfied: pillow&gt;=5.3.0 in c:\users\Emil\anaconda3\lib\site-packages (from torchvision) (8.0.1)

Then, I tried to import torch in Spyder but received the following error:
import torch
C:\Users\Emil\AppData\Roaming\Python\Python38\site-packages\torch\package\_mock_zipreader.py:17: UserWarning: Failed to initialize NumPy: numpy.core.multiarray failed to import (Triggered internally at  ..\torch\csrc\utils\tensor_numpy.cpp:67.)
  _dtype_to_storage = {data_type(0).dtype: data_type for data_type in _storages}
Traceback (most recent call last):

  File &quot;&lt;ipython-input-1-eb42ca6e4af3&gt;&quot;, line 1, in &lt;module&gt;
    import torch

  File &quot;C:\Users\Emil\AppData\Roaming\Python\Python38\site-packages\torch\__init__.py&quot;, line 705, in &lt;module&gt;
    import torch.utils.data

  File &quot;C:\Users\Emil\AppData\Roaming\Python\Python38\site-packages\torch\utils\data\__init__.py&quot;, line 28, in &lt;module&gt;
    from torch.utils.data import datapipes

  File &quot;C:\Users\Emil\AppData\Roaming\Python\Python38\site-packages\torch\utils\data\datapipes\__init__.py&quot;, line 1, in &lt;module&gt;
    from . import iter

  File &quot;C:\Users\Emil\AppData\Roaming\Python\Python38\site-packages\torch\utils\data\datapipes\iter\__init__.py&quot;, line 8, in &lt;module&gt;
    from torch.utils.data.datapipes.iter.callable import \

  File &quot;C:\Users\Emil\AppData\Roaming\Python\Python38\site-packages\torch\utils\data\datapipes\iter\callable.py&quot;, line 13, in &lt;module&gt;
    dill.extend(use_dill=False)

AttributeError: module 'dill' has no attribute 'extend'    

What can I do to overcome this error?

Based on Mike McKerns' comment, I successfully used:
pip install dill --upgrade

