9

I cannot use PyTorch and Shap getting this error

PyTorch Error loading  "\lib\site-packages\torch\lib\shm.dll" or one of its dependencies.

I have tried

  • to uninstall and re-install PyTorch, failed
  • create a new conda environment and reinstalled everything including PyTorch, failed
  • to install .NET C++ as suggested in other posts, but it was already installed

I am not an expert on SO and dependencies, but i find it strange that there is not an easy way to fix it. Any idea?

fede72bari
  • 343
  • 5
  • 17
  • How are you installing? – erip Nov 27 '22 at 23:39
  • Does `\lib\site-packages\torch\lib\shm.dll` exist? Do you have sufficient privileges to load it? – Sergey Bushmanov Nov 28 '22 at 03:28
  • 1
    I use the suggested instructions for installing found in Anaconda website. The dll exists. I have fixed it just installing a third new conda environment. But I don't know what is changed between all these attempts. The only thing could be a different installation sequence even if I find it so strange. – fede72bari Nov 28 '22 at 11:29

2 Answers2

7

I manage to get past the error by conda install cudatoolkit

Dung Tran
  • 357
  • 1
  • 2
  • 13
0

i fixed Error loading "torch\lib\shm.dll" or one of its dependencies

use : conda install cudatoolkit

if still getting the above error after running the above command. you should restart the computer and then turn on anaconda again.

I would be happy if I could help

hayhahy
  • 13
  • 2