FileNotFoundError: Could not find module "...\c10.dll"

Hi,
Trying to run my code after installing torch and receive the following error:

Traceback (most recent call last):
File “C:\Users\ויקי\Desktop\ABCD_project\gordon_correlations_algorithms\run_cv.py”, line 5, in
import test
File “C:\Users\ויקי\Desktop\ABCD_project\gordon_correlations_algorithms\test.py”, line 10, in
import torch
File “C:\python38\lib\site-packages\torch_init_.py”, line 81, in
ctypes.CDLL(dll)
File “C:\python38\lib\ctypes_init_.py”, line 369, in init
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module ‘C:\python38\lib\site-packages\torch\lib\c10.dll’. Try using the full path with constructor syntax.

c10.dll exists in the folder.
Python version: 3.8.0 64 bit
Windows 10 64 bit
pytorch install: pip install torch==1.5.1+cpu torchvision==0.6.1+cpu -f https://download.pytorch.org/whl/torch_stable.html

Can you help me please?

Have you installed VS2019 redist? https://aka.ms/vs/16/release/vc_redist.x64.exe

3 Likes

This solved the problem. Thank you!

1 Like

How did you solved ?

Genius solution. However I don’t understand how it’s related to pytorch not finding a file.

Just installed the VS2019 redist

Good afternoon, I still have this problem, installed pytorch using conda, for CPU. Anybody know how to solve this? The c10.dll file surely is in the specified folder.