# Cannot load models with miniconda installation

**URL:** <https://discuss.huggingface.co/t/cannot-load-models-with-miniconda-installation/25946>\
**Category:** 🤗Transformers\
**Created:** [November 11, 2022, 7:19pm UTC](https://discuss.huggingface.co/t/cannot-load-models-with-miniconda-installation/25946 "2022-11-11T19:19:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MyaBakhova](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@MyaBakhova](https://discuss.huggingface.co/u/MyaBakhova)\
**Post date:** [November 11, 2022, 7:19pm UTC](https://discuss.huggingface.co/t/cannot-load-models-with-miniconda-installation/25946/1 "2022-11-11T19:19:59Z")

</div>

Hello everybody,  
I have Windows 10, 32 Gb of memory and 8 CPUs. I’m using Miniconda3.  
I have `tensorflow` and `pytorch`, and installed huggingface transformers using the following lines:

```auto
conda install -c huggingface transformers
conda update --all

```

It went without a glitch.  
But when I tried to import some methods I got an error message.

```auto
from transformers import BertTokenizer, TFBertForSequenceClassification

```

* * *

OSError Traceback (most recent call last)  
~\miniconda3\lib\site-packages\transformers\utils\import\_utils.py in \_get\_module(self, module\_name)  
1075 try:  
 → 1076 return importlib.import\_module(“.” + module\_name, self. **name** )  
1077 except Exception as e:

~\miniconda3\lib\importlib\__init_\_.py in import\_module(name, package)  
126 level += 1  
 → 127 return \_bootstrap.\_gcd\_import(name[level:], package, level)  
128

~\miniconda3\lib\importlib\_bootstrap.py in \_gcd\_import(name, package, level)

~\miniconda3\lib\importlib\_bootstrap.py in _find\_and\_load(name, import_)

~\miniconda3\lib\importlib\_bootstrap.py in _find\_and\_load\_unlocked(name, import_)

~\miniconda3\lib\importlib\_bootstrap.py in \_load\_unlocked(spec)

~\miniconda3\lib\importlib\_bootstrap\_external.py in exec\_module(self, module)

~\miniconda3\lib\importlib\_bootstrap.py in \_call\_with\_frames\_removed(f, \*args, \*\*kwds)

~\miniconda3\lib\site-packages\transformers\models\bert\modeling\_bert.py in   
24  
—\> 25 import torch  
26 import torch.utils.checkpoint

~\miniconda3\lib\site-packages\torch\__init_\_.py in   
123 err.strerror += f’ Error loading “{dll}” or one of its dependencies.’  
 → 124 raise err  
125 elif res is not None:

OSError: [WinError 182] The operating system cannot run %1. Error loading “C:\Users\mathe\miniconda3\lib\site-packages\torch\lib\caffe2\_detectron\_ops.dll” or one of its dependencies.

The above exception was the direct cause of the following exception:

RuntimeError Traceback (most recent call last)  
~\AppData\Local\Temp\ipykernel\_15348\3250769049.py in   
1 import tensorflow as tf  
2 import pandas as pd  
----\> 3 from transformers import BertConfig, BertModel

~\miniconda3\lib\importlib\_bootstrap.py in _handle\_fromlist(module, fromlist, import_, recursive)

~\miniconda3\lib\site-packages\transformers\utils\import\_utils.py in **getattr** (self, name)  
1065 elif name in self.\_class\_to\_module.keys():  
1066 module = self.\_get\_module(self.\_class\_to\_module[name])  
 → 1067 value = getattr(module, name)  
1068 else:  
1069 raise AttributeError(f"module {self. **name** } has no attribute {name}")

~\miniconda3\lib\site-packages\transformers\utils\import\_utils.py in **getattr** (self, name)  
1064 value = self.\_get\_module(name)  
1065 elif name in self.\_class\_to\_module.keys():  
 → 1066 module = self.\_get\_module(self.\_class\_to\_module[name])  
1067 value = getattr(module, name)  
1068 else:

~\miniconda3\lib\site-packages\transformers\utils\import\_utils.py in \_get\_module(self, module\_name)  
1076 return importlib.import\_module(“.” + module\_name, self. **name** )  
1077 except Exception as e:  
 → 1078 raise RuntimeError(  
1079 f"Failed to import {self. **name** }.{module\_name} because of the following error (look up to see its"  
1080 f" traceback):\n{e}"

## RuntimeError: Failed to import transformers.models.bert.modeling\_bert because of the following error (look up to see its traceback): [WinError 182] The operating system cannot run %1. Error loading “C:\Users\my\_name\miniconda3\lib\site-packages\torch\lib\caffe2\_detectron\_ops.dll” or one of its dependencies.

Something appears to be missing.  
I will appreciate your help,  
Mya
