Ordinal 191 not found when importing torch

username: Yann_Majewski
cooked: <p>Hi, i have this issue where when i import torch I get the error:</p>
<p>The ordinal 191 could not be located in the dynamic link library<br>
C:/Users/Public/anaconda3/envs/python/lib/site-packages/torch/lib/torch_cpu.ddll</p>
<p>also:<br>
C:/Users/Public/anaconda3/envs/python/lib/site-packages/torch/lib/torch_gpu.ddll</p>
<p>Ive tried uninstalling anaconda and reinstalling, uninstalling pytorch and reinstalling…</p>
<p>Nothing seems to fix that and it happened over night it seems! PLEASE HELP!</p>

username: ptrblck
cooked: <p>This seems to be a conda issue, at least that’s what searching for this error yields. Did you recently reinstall anaconda?<br>
Could you create a new virtual environment and reinstall PyTorch, please?</p>

username: Yann_Majewski
cooked: <p>Hey, thanks for your answer! I’ve tried making a new environment and same thing happened, something very weird is happening. Ive reinstalled anaconda and same thing… other packages are working only pytorch is giving me this error, here is a picture of the error: <div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/d/8/d81735e454683be0f52631557c21dd660074f476.png" data-download-href="https://discuss.pytorch.org/uploads/default/d81735e454683be0f52631557c21dd660074f476" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/d/8/d81735e454683be0f52631557c21dd660074f476.png" alt="image" data-base62-sha1="uPCRrcS0AV7toQLJo7X9Vld1XaS" width="690" height="282" data-dominant-color="F9FAFA"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">910×372 12.2 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>And i get the pop up ordinal 191 could not be located. I’ve looked online and i can’t find any solution to this problem</p>

username: ptrblck
cooked: <p>Could you try to use some of the suggested workarounds from <a href="https://github.com/ContinuumIO/anaconda-issues/issues/10213">this issue</a>?<br>
Also, which conda and PyTorch version are you using?</p>

username: Yann_Majewski
cooked: <p>Here is my anaconda info:</p>
<pre><code>active environment : python
active env location : C:\Users\Public\anaconda3\envs\python
        shell level : 1
   user config file : C:\Users\Yann Majewski\.condarc
</code></pre>
<p>populated config files : C:\Users\Yann Majewski.condarc<br>
conda version : 4.8.2<br>
conda-build version : 3.18.11<br>
python version : 3.7.6.final.0<br>
virtual packages : __cuda=11.0</p>
<p>Im using the latest stable pytorch version 1.5. Is it possible there is a problem with compatibility?<br>
I looked up the workarounds however it doesn’t really seem to be a similar problem. Im encountering this error only with pytorch. Its like it cant find the packages…</p>

username: Yann_Majewski
cooked: <p>Hey <a class="mention" href="/u/ptrblck">@ptrblck</a> I found the solution, there was a corrupted torch_cpu.dll file somewhere in one of the file probably from another install. Removing this copy allowed it to find the real torch_cpu.dll file and everything works now. Thank you for your time!</p>

username: mahyar-osn
cooked: <p>Hi <a class="mention" href="/u/yann_majewski">@Yann_Majewski</a> ,<br>
I have the exact same issue. Would you mind telling me how you found that corrupted file please?<br>
Cheers!</p>

username: mahyar-osn
cooked: <p>I found a workaround. I made a new venv with Python 3.8.3 and installed PyTorch again and all is working fine now.<br>
p.s. I use <code>pip</code> and not <code>anaconda</code> (I hate <code>anaconda</code>! <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=9" title=":slight_smile:" class="emoji" alt=":slight_smile:">)</p>

username: Yann_Majewski
cooked: <p>Hi <a class="mention" href="/u/mahyar-osn">@mahyar-osn</a>,</p>
<p>Actually my problem wasnt even because of that file, i found that when i was downloading a sofware to open histoloy images it did something to my computer that corrupted some files or something like that. So  uninstalling it solved my problem!</p>
<p>Best regards,</p>