# Installing transformers library

**URL:** <https://discuss.huggingface.co/t/installing-transformers-library/104962>\
**Category:** Beginners\
**Created:** [September 2, 2024, 1:43pm UTC](https://discuss.huggingface.co/t/installing-transformers-library/104962 "2024-09-02T13:43:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rengel](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@rengel](https://discuss.huggingface.co/u/rengel)\
**Post date:** [September 2, 2024, 1:43pm UTC](https://discuss.huggingface.co/t/installing-transformers-library/104962/1 "2024-09-02T13:43:43Z")

</div>

Hello everyone,  
I’m encountering an issue with PyTorch on my Windows system, and I’m hoping someone here can help me resolve it.

I tried to run a simple script using the `transformers` library with PyTorch, but I keep getting the following error:

OSError: [WinError 126] Das angegebene Modul wurde nicht gefunden. Error loading “C:\Users\roman.vscode\BMA\Code.env\Lib\site-packages\torch\lib\fbgemm.dll” or one of its dependencies.

Steps I’ve Tried

Reinstalled PyTorch:  
I uninstalled and reinstalled PyTorch using the following command:

pip uninstall torch  
pip install torch torchvision torchaudio --index-url [https://download.pytorch.org/whl/cpu](https://download.pytorch.org/whl/cpu)

Administrator Mode: I ran PowerShell as an administrator and tried creating the virtual environment and reinstalling everything, but the problem persists.

System Information:

Operating System: Windows 11 64-bit  
Python Version: 3.11.9  
PyTorch Version: Latest CPU version from the official PyTorch website  
Virtual Environment: Created using `python -m venv .env`

I’m stuck and not sure what else to try. Has anyone encountered this issue before, or does anyone have suggestions on how to resolve this? Any advice or troubleshooting tips would be greatly appreciated!

Thanks in advance for your help!

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [September 2, 2024, 10:48pm UTC](https://discuss.huggingface.co/t/installing-transformers-library/104962/2 "2024-09-02T22:48:08Z")

</div>

Try this.

```auto
python -m pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://download.pytorch.org/whl/cu118

```

## Source (sorry in Japanese)

> **[import torchのOSErrorが解決できた話 - Qiita](https://qiita.com/UKI_datascience/items/2626dba5bba8f51fcb85)**
>
> 自己紹介 データサイエンスを学んでいる、大学4年生です。 最近は、SIGNATEのコンペに4つ参加しながら、東京大学の松尾・岩澤研究室主催のサマースクールを3つ受講し、マナビDXにも参加しています。 Xはこちら→@uki\_datascience 背景 今回は、BERTを...

---

<div class="post-metadata">

**Author:** ![DgmeInsider](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/dgmeinsider/32/31398_2.png) [@DgmeInsider](https://discuss.huggingface.co/u/DgmeInsider)\
**Post date:** [September 8, 2024, 5:04pm UTC](https://discuss.huggingface.co/t/installing-transformers-library/104962/3 "2024-09-08T17:04:23Z")

</div>

The error you’re encountering is often caused by missing system dependencies, such as the Microsoft Visual C++ Redistributable. Try installing or updating the [DGME](https://dgmeinsider.site) latest version of this package, restart your system, and then run your script again. Also, ensure that your Python and PyTorch versions are compatible, as version mismatches can lead to issues with loading DLLs like fbgemm.dll.
