I have created a virtual environment using
python -m venv .
I don’t have a Cuda GPU, so I selected the CPU
option from the installation which was:
pip3 install torch torchvision torchaudio
when I tried to import torch I got the below error:
(ali) C:\Users\pc\ali>python
Python 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
import torch
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\pc\ali\Lib\site-packages\torch_init_.py”, line 141, in
raise err
OSError: [WinError 126] The specified module could not be found. Error loading “C:\Users\pc\ali\Lib\site-packages\torch\lib\fbgemm.dll” or one of its dependencies.
So I did this:
pip uninstall torch
and then tried from online resources the following:
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
and still the same problem happens.
It is probably worth mentioning, I checked that fbgemm.dll
is actually there and so it is probably one of its dependencies that is missing. I tried viewing them (on my friends machine where the installation worked with no issues) in Dependency walker and here is the photo I found on his:
from googling these seems to be MSVC/C++ runtime dependencies? is it required that I install some C++ stuff?