# ImportError: DLL load failed while importing \_C: Das angegebene Modul wurde nicht gefunden./The specified module can not be found

**URL:** <https://discuss.pytorch.org/t/importerror-dll-load-failed-while-importing-c-das-angegebene-modul-wurde-nicht-gefunden-the-specified-module-can-not-be-found/217569>\
**Category:** Uncategorized\
**Created:** [March 7, 2025, 7:08pm UTC](https://discuss.pytorch.org/t/importerror-dll-load-failed-while-importing-c-das-angegebene-modul-wurde-nicht-gefunden-the-specified-module-can-not-be-found/217569 "2025-03-07T19:08:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nimajneb](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/n/f1d935/32.png) [@nimajneb](https://discuss.pytorch.org/u/nimajneb)\
**Post date:** [March 7, 2025, 7:08pm UTC](https://discuss.pytorch.org/t/importerror-dll-load-failed-while-importing-c-das-angegebene-modul-wurde-nicht-gefunden-the-specified-module-can-not-be-found/217569/1 "2025-03-07T19:08:46Z")

</div>

Hi everyone,  
Ive just installed torch and torchvision on my anaconda shell:

# packages in environment at C:\Users\benja\anaconda3:

# 

# Name Version Build Channel

pytorch 2.5.1 py3.11\_cpu\_0 pytorch  
pytorch-mutex 1.0 cpu pytorch

# packages in environment at C:\Users\benja\anaconda3:

# 

# Name Version Build Channel

torchvision 0.20.1 py311\_cpu pytorch

However, when I am trying import torch and torchvision, the following message is displayed:

* * *

ImportError Traceback (most recent call last)  
Cell In[7], line 3  
1 import inspect  
2 import torch  
----\> 3 import torchvision  
4 from torch import nn  
5 from torch import optim

File ~\anaconda3\Lib\site-packages\torchvision\__init_\_.py:9  
5 import torch  
7 # Don’t re-order these, we need to load the \_C extension (done when importing  
8 # .extensions) before entering \_meta\_registrations.  
----\> 9 from .extension import \_HAS\_OPS # usort:skip  
10 from torchvision import \_meta\_registrations, datasets, io, models, ops, transforms, utils # usort:skip  
12 try:

File ~\anaconda3\Lib\site-packages\torchvision\extension.py:6  
2 import sys  
4 import torch  
----\> 6 from .\_internally\_replaced\_utils import \_get\_extension\_path  
9 \_HAS\_OPS = False  
12 def \_has\_ops():

File ~\anaconda3\Lib\site-packages\torchvision\_internally\_replaced\_utils.py:4  
1 import importlib.machinery  
2 import os  
----\> 4 from torch.hub import \_get\_torch\_home  
7 \_HOME = os.path.join(\_get\_torch\_home(), “datasets”, “vision”)  
8 \_USE\_SHARDED\_DATASETS = False

File ~\anaconda3\Lib\site-packages\torch\hub.py:22  
19 from urllib.request import Request, urlopen  
21 import torch  
—\> 22 from torch.serialization import MAP\_LOCATION  
25 class \_Faketqdm: # type: ignore[no-redef]  
26 def **init** (self, total=None, disable=False, unit=None, \*args, \*\*kwargs):

File ~\anaconda3\Lib\site-packages\torch\serialization.py:35  
33 import torch  
34 import torch.\_weights\_only\_unpickler as \_weights\_only\_unpickler  
—\> 35 from torch.\_sources import get\_source\_lines\_and\_file  
36 from torch.\_utils import \_import\_dotted\_name  
37 from torch.storage import \_get\_dtype\_from\_pickle\_storage\_type

File ~\anaconda3\Lib\site-packages\torch\_sources.py:8  
5 from textwrap import dedent  
6 from typing import Any, List, NamedTuple, Optional, Tuple  
----\> 8 from torch.\_C import ErrorReport  
9 from torch.\_C.\_jit\_tree\_views import SourceRangeFactory  
12 def get\_source\_lines\_and\_file(  
13 obj: Any,  
14 error\_msg: Optional[str] = None,  
15 ) → Tuple[List[str], int, Optional[str]]:

ImportError: DLL load failed while importing \_C: Das angegebene Modul wurde nicht gefunden.

How to solve this issue?

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [March 7, 2025, 7:19pm UTC](https://discuss.pytorch.org/t/importerror-dll-load-failed-while-importing-c-das-angegebene-modul-wurde-nicht-gefunden-the-specified-module-can-not-be-found/217569/2 "2025-03-07T19:19:44Z")

</div>

Not reproducible by installing `2.5.1+cpu` from `conda`:

```python
conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 cpuonly -c pytorch
...
The following packages will be downloaded:

    package | build
    ---------------------------|-----------------
    brotli-python-1.0.9 | py311h6a678d5_9 356 KB
    certifi-2025.1.31 | py311h06a4308_0 163 KB
    filelock-3.13.1 | py311h06a4308_0 24 KB
    gmpy2-2.2.1 | py311h5eee18b_0 248 KB
    idna-3.7 | py311h06a4308_0 133 KB
    jinja2-3.1.5 | py311h06a4308_0 358 KB
    markupsafe-3.0.2 | py311h5eee18b_0 27 KB
    mkl-service-2.4.0 | py311h5eee18b_2 69 KB
    mkl_fft-1.3.11 | py311h5eee18b_0 207 KB
    mkl_random-1.2.8 | py311ha02d727_0 328 KB
    mpmath-1.3.0 | py311h06a4308_0 1.0 MB
    networkx-3.4.2 | py311h06a4308_0 3.1 MB
    numpy-2.0.1 | py311h08b1b3b_1 11 KB
    numpy-base-2.0.1 | py311hf175353_1 9.1 MB
    pillow-11.1.0 | py311hcea889d_0 973 KB
    pysocks-1.7.1 | py311h06a4308_0 35 KB
    pytorch-2.5.1 | py3.11_cpu_0 92.0 MB pytorch
    pyyaml-6.0.2 | py311h5eee18b_0 223 KB
    requests-2.32.3 | py311h06a4308_1 126 KB
    sympy-1.13.3 | py311h06a4308_1 15.4 MB
    torchaudio-2.5.1 | py311_cpu 5.1 MB pytorch
    torchvision-0.20.1 | py311_cpu 7.1 MB pytorch
    typing_extensions-4.12.2 | py311h06a4308_0 81 KB
    urllib3-2.3.0 | py311h06a4308_0 241 KB
    ------------------------------------------------------------
                                           Total: 136.4 MB

```

```python
>>> import torch                                                                                                                                                                                                   
>>> import torchvision
>>> torch. __version__                                                                                                                                                                                              
'2.5.1'                                                                                                                                                                                                            
>>> torchvision. __version__                                                                                                                                                                                        
'0.20.1'     

```

---

<div class="post-metadata">

**Author:** ![nimajneb](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/n/f1d935/32.png) [@nimajneb](https://discuss.pytorch.org/u/nimajneb)\
**Post date:** [March 7, 2025, 7:41pm UTC](https://discuss.pytorch.org/t/importerror-dll-load-failed-while-importing-c-das-angegebene-modul-wurde-nicht-gefunden-the-specified-module-can-not-be-found/217569/3 "2025-03-07T19:41:26Z")

</div>

> [@ptrblck](#):
>
> `import torch `

to clarify, I am working on jupyter with Python 3.11.7. When am trying to import, the kernel dies.
