# Can't import Pipeline from Transformers

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcant-import-pipeline-from-transformers%2F103365%3E%5C
**Category:** Beginners\
**Created:** [August 21, 2024, 3:54pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcant-import-pipeline-from-transformers%2F103365 "2024-08-21T15:54:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aalekh29](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@aalekh29](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Faalekh29)%5C
**Post date:** [August 21, 2024, 3:54pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcant-import-pipeline-from-transformers%2F103365%2F1 "2024-08-21T15:54:02Z")

</div>

I have to work on GPT Neo model and generate text output by asking some questions (automotive related). I am doing NLP related work for first time.

I am using Jupyter notebook and have installed pytorch, and transformers. But I am unable to import Pipeline to further write prompts.

I have tried installing the latest version of pytorch and transformers as well as tried to work with older version of transformers as well

!pip install transformers

OR

!pip install transformers==4.44.1

OR

!pip install transformers==4.28.0

Here’s the error.

[WINERROR126]: The specific module could not be found.

* * *

* * *

OSError Traceback (most recent call last)  
Cell In[5], line 1  
----\> 1 from transformers import pipeline

File ~\anaconda3\Lib\site-packages\transformers\__init_\_.py:26  
23 from typing import TYPE\_CHECKING  
25 # Check the dependencies satisfy the minimal versions required.  
—\> 26 from . import dependency\_versions\_check  
27 from .utils import (  
28 OptionalDependencyNotAvailable,  
29 \_LazyModule,  
(…)  
48 logging,  
49 )  
52 logger = logging.get\_logger( **name** ) # pylint: disable=invalid-name

File ~\anaconda3\Lib\site-packages\transformers\dependency\_versions\_check.py:16  
1 # Copyright 2020 The HuggingFace Team. All rights reserved.  
2 #  
3 # Licensed under the Apache License, Version 2.0 (the “License”);  
(…)  
12 # See the License for the specific language governing permissions and  
13 # limitations under the License.  
15 from .dependency\_versions\_table import deps  
—\> 16 from .utils.versions import require\_version, require\_version\_core  
19 # define which module versions we always want to check at run time  
20 # (usually the ones defined in `install_requires` in setup.py)  
21 #  
22 # order specific notes:  
23 # - tqdm must be checked before tokenizers  
25 pkgs\_to\_check\_at\_runtime = [  
26 “python”,  
27 “tqdm”,  
(…)  
37 “pyyaml”,  
38 ]

File ~\anaconda3\Lib\site-packages\transformers\utils\__init_\_.py:34  
25 from .constants import IMAGENET\_DEFAULT\_MEAN, IMAGENET\_DEFAULT\_STD, IMAGENET\_STANDARD\_MEAN, IMAGENET\_STANDARD\_STD  
26 from .doc import (  
27 add\_code\_sample\_docstrings,  
28 add\_end\_docstrings,  
(…)  
32 replace\_return\_docstrings,  
33 )  
—\> 34 from .generic import (  
35 ContextManagers,  
36 ExplicitEnum,  
37 ModelOutput,  
38 PaddingStrategy,  
39 TensorType,  
40 add\_model\_info\_to\_auto\_map,  
41 add\_model\_info\_to\_custom\_pipelines,  
42 cached\_property,  
43 can\_return\_loss,  
44 expand\_dims,  
45 filter\_out\_non\_signature\_kwargs,  
46 find\_labels,  
47 flatten\_dict,  
48 infer\_framework,  
49 is\_jax\_tensor,  
50 is\_numpy\_array,  
51 is\_tensor,  
52 is\_tf\_symbolic\_tensor,  
53 is\_tf\_tensor,  
54 is\_torch\_device,  
55 is\_torch\_dtype,  
56 is\_torch\_tensor,  
57 reshape,  
58 squeeze,  
59 strtobool,  
60 tensor\_size,  
61 to\_numpy,  
62 to\_py\_obj,  
63 torch\_float,  
64 torch\_int,  
65 transpose,  
66 working\_or\_temp\_dir,  
67 )  
68 from .hub import (  
69 CLOUDFRONT\_DISTRIB\_PREFIX,  
70 HF\_MODULES\_CACHE,  
(…)  
96 try\_to\_load\_from\_cache,  
97 )  
98 from .import\_utils import (  
99 ACCELERATE\_MIN\_VERSION,  
100 ENV\_VARS\_TRUE\_AND\_AUTO\_VALUES,  
(…)  
219 torch\_only\_method,  
220 )

File ~\anaconda3\Lib\site-packages\transformers\utils\generic.py:462  
458 return tuple(self[k] for k in self.keys())  
461 if is\_torch\_available():  
 → 462 import torch.utils.\_pytree as \_torch\_pytree  
464 def \_model\_output\_flatten(output: ModelOutput) → Tuple[List[Any], “\_torch\_pytree.Context”]:  
465 return list(output.values()), list(output.keys())

File ~\anaconda3\Lib\site-packages\torch\__init_\_.py:148  
146 err = ctypes.WinError(ctypes.get\_last\_error())  
147 err.strerror += f’ Error loading “{dll}” or one of its dependencies.’  
 → 148 raise err  
150 kernel32.SetErrorMode(prev\_error\_mode)  
153 def \_preload\_cuda\_deps(lib\_folder, lib\_name):

OSError: [WinError 126] The specified module could not be found. Error loading “C:\Users\aalek\anaconda3\Lib\site-packages\torch\lib\fbgemm.dll” or one of its dependencies.

---

<div class="post-metadata">

**Author:** ![mahmutc](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mahmutc/32/64626_2.png) [@mahmutc](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmahmutc)%5C
**Post date:** [August 22, 2024, 7:22am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcant-import-pipeline-from-transformers%2F103365%2F2 "2024-08-22T07:22:47Z")

</div>

If you haven’t seen yet, please check [Failed to import pytorch fbgemm.dll or one of its dependencies is missing - windows - PyTorch Forums](https://discuss.pytorch.org/t/failed-to-import-pytorch-fbgemm-dll-or-one-of-its-dependencies-is-missing/201969).
