# ModuleNotFoundError: No module named 'transformers.modeling\_roberta'

**URL:** <https://discuss.huggingface.co/t/modulenotfounderror-no-module-named-transformers-modeling-roberta/11175>\
**Category:** 🤗Transformers\
**Created:** [October 28, 2021, 6:38pm UTC](https://discuss.huggingface.co/t/modulenotfounderror-no-module-named-transformers-modeling-roberta/11175 "2021-10-28T18:38:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![seyeeet](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@seyeeet](https://discuss.huggingface.co/u/seyeeet)\
**Post date:** [October 28, 2021, 6:38pm UTC](https://discuss.huggingface.co/t/modulenotfounderror-no-module-named-transformers-modeling-roberta/11175/1 "2021-10-28T18:38:12Z")

</div>

im trying to use longformer and in its code it has `from transformers.modeling_roberta import RobertaConfig, RobertaModel, RobertaForMaskedLM`  
but although I install the `transformers` and I can do `import transformers` I still get an error when I do:  
`from transformers.modeling_roberta import RobertaConfig, RobertaModel, RobertaForMaskedLM `  
any suggestion on how to install it? or what to do?

---

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](https://discuss.huggingface.co/u/sgugger)\
**Post date:** [October 28, 2021, 7:54pm UTC](https://discuss.huggingface.co/t/modulenotfounderror-no-module-named-transformers-modeling-roberta/11175/2 "2021-10-28T19:54:54Z")

</div>

You should import those objects from `transformers` directly.

---

<div class="post-metadata">

**Author:** ![seyeeet](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@seyeeet](https://discuss.huggingface.co/u/seyeeet)\
**Post date:** [November 16, 2021, 7:30pm UTC](https://discuss.huggingface.co/t/modulenotfounderror-no-module-named-transformers-modeling-roberta/11175/3 "2021-11-16T19:30:33Z")

</div>

Im not able to do it, does it mean I have not install some of the parts correctly?
