Cannot import pytorch afther installation

I decided to install pytorch on my desktop. For this I looked up pytorch site and ran the following recommended command in my Anaconda prompt:

conda install pytorch torchvision torchaudio cpuonly -c pytorch

All went fine.
I followed it by conda update --all and conda clean --all.
Then I tried in my jupyter notebook:

import tensorflow as tf
import torch

And I got an error message:

OSError                                   Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_15588\ in <module>
      1 import tensorflow as tf
      2 import pandas as pd
----> 3 import torch

~\miniconda3\lib\site-packages\torch\ in <module>
    126                 err = ctypes.WinError(last_error)
    127                 err.strerror += f' Error loading "{dll}" or one of its dependencies.'
--> 128                 raise err
    129             elif res is not None:
    130                 is_loaded = True

OSError: [WinError 182] The operating system cannot run %1. Error loading "C:\Users\mathe\miniconda3\lib\site-packages\torch\lib\shm.dll" or one of its dependencies.

I’ve tried a number of things since then. I updated conda, re-install tensoflow and pytorch and updated everything again, tried import in Spyder, just in case, and re-start my desktop. I still get the same mistake. The installation-import works on my Ubuntu 18 laptop, so I believe that it is Windows problem.
I use conda for consistency. Quite often I work with students and clients, and they prefer conda.
This is a base conda environment and not my created environment.
Best regards,

thanks for your reply. What tensors do you mean? Because there are no tensors mentioned in the error message.

I would ignore the previous message as it seems to come from a bot posting unrelated questions/answers and I’ve deleted it.

For your issue: could you check what the missing dependency in the dll is?
I’m not deeply familiar with Windows, but maybe dumpbin /dependents PATH...\shm.dll could help.

@myabakhova, I’m using a windows version and conda environment, facing a similar issue. Could you please suggest me on how you got it resolved?

Hello Niraj,
nothing fancy, I rebooted my computer and the problem was resolved.