Pytorch Error after installation

Hello,
When I type import torch on python console, this is what going on:

import torch
Microsoft Visual C++ Redistributable is not installed, this may lead to the DLL load failure.
It can be downloaded at https://aka.ms/vs/16/release/vc_redist.x64.exe
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\ziywa\anaconda3\lib\site-packages\torch_init_.py”, line 128, in
raise err
OSError: [WinError 126] The specified module could not be found.

Installation was successful.

Best,
Ziyue Wang

Hi,

Have you tried following the instruction from the error and install the missing component?

ok. Even after I installed this successfully, I still cannot run a program with torch this on pycharm (ModuleNotFoundError: No module named ‘torch’). I can do it on python console.

I guess the issue is that pycharm is not using the same python as the one in your console where you installed pytorch.
You will need to make sure that pycharm use the same python as the one you installed torch in.