Cannot import pytorch on wsl2

username: fjanoos
cooked: <p>Hello,<br>
I’m trying to use pytorch from inside my wsl2 python installation (details below)</p>
<pre><code class="lang-auto">&gt;python --version                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
Python 3.9.7 


&gt; conda list | grep -i torch                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
cpuonly                   2.0                           0    pytorch                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
pytorch                   1.10.0              py3.9_cpu_0    pytorch                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
pytorch-mutex             1.0                         cpu    pytorch    
</code></pre>
<p>This is the error I get when I try to import torch:</p>
<pre><code class="lang-auto">In [1]: import torch                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

----------------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        &lt;ipython-input-1-eb42ca6e4af3&gt; in &lt;module&gt;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ----&gt; 1 import torch                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ~/software/anaconda3/lib/python3.9/site-packages/torch/__init__.py in &lt;module&gt;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         194     # See Note [Global dependencies]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
195     if USE_GLOBAL_DEPS:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
--&gt; 196         _load_global_deps()                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
197     from torch._C import *  # noqa: F403                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
198                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
~/software/anaconda3/lib/python3.9/site-packages/torch/__init__.py in _load_global_deps()                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
147     lib_path = os.path.join(os.path.dirname(here), 'lib', lib_name)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
148                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
--&gt; 149     ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
150                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
151                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
~/software/anaconda3/lib/python3.9/ctypes/__init__.py in __init__(self, name, mode, handle, 
use_errno, use_last_error, winmode)                                                                                                                                                                                                                                                                                                                                                                                                                                         
380                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
381         if handle is None:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
--&gt; 382             self._handle = _dlopen(self._name, mode)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
383         else:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
384             self._handle = handle                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
OSError: /home/fj/software/anaconda3/lib/python3.9/site-
packages/torch/lib/../../../../libmkl_gnu_thread.so: unexpected reloc type 0x00000907       
</code></pre>
<p>Any pointers/links to what the issue might be would be appreciated.</p>
<p>Thanks</p>