OSError: [WinError 182] The operating system cannot run %1

I used the torch earlier but suddenly today when I tried importing the torch I got this error message, i tried updating the pytorch as suggested by GitHub ( Issues · conda-forge/openmp-feedstock · GitHub) issue section but that didn’t help

Error message -

import torch
Traceback (most recent call last):
File “”, line 1, in
File “D:\anaconda\envs\Pytorch\lib\site-packages\torch_init_.py”, line 130, in
raise err
OSError: [WinError 182] The operating system cannot run %1. Error loading “D:\anaconda\envs\Pytorch\lib\site-packages\torch\lib\fbgemm.dll” or one of its dependencies

Could you create a new and empty virtual environment and reinstall PyTorch there as a quick test to see if some packages were deleted or are conflicting in your current env?

@ptrblck help me
It did work on the new environment but I reinstalled the pytorch in the existing environment and it didn’t work, it is difficult for me to switch to a new environment as taking all the modules and reinstalling them is a tedious task. Is there any other way to solve it?

I’m not familiar enough with Windows and don’t know what might have corrupted your environment. It seems you might be able to find missing files via dumpbin /depends fbgemm.dll which might help you trying to restore the env.

I discovered that it is happening due to the module MNE-Python used in the preprocessing, analysis, and visualization of EEG data. When I reinstalled the pytorch in the new environment it worked fine, and after I installed the mne module errors started occurring this module was the last module I installed before I received the error the first time. Any suggestion for its replacement, I tried to use biosig, but for some reason, it is not getting installed.

I’m not familiar with MNE-Python and don’t know how it interacts with PyTorch, but it’s still weird its installation causes library issues in PyTorch. Unfortunately, I also don’t know any replacement of it, but you might want to check if installing MNE-Python would downgrade PyTorch for some reason.