# Error loading "\\lib\\site-packages\\torch\\lib\\shm.dll" or one of its dependencie

**URL:** <https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695>\
**Category:** Uncategorized\
**Created:** [April 27, 2024, 9:38am UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695 "2024-04-27T09:38:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![srinim](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/srinim/32/62604_2.png) [@srinim](https://discuss.pytorch.org/u/srinim)\
**Post date:** [April 27, 2024, 9:38am UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/1 "2024-04-27T09:38:05Z")

</div>

I installed torch using “pip install torch” command. it was working.  
I did install torchvision using “pip install torchvision” . after that started getting following error .  
Error loading “\lib\site-packages\torch\lib\shm.dll” or one of its dependencies

Note: Uninstalled torch, torchvision and re-installed torch. still the issue persisted.

---

<div class="post-metadata">

**Author:** ![Alexander\_DE](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/alexander_de/32/66937_2.png) [@Alexander\_DE](https://discuss.pytorch.org/u/Alexander_DE)\
**Post date:** [April 30, 2024, 1:55pm UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/2 "2024-04-30T13:55:36Z")

</div>

I have same issue (Windows 10, Cuda 12.1, Python 3.11).  
Going back to Torch==2.2.2 fixed it for me, 2.3 failed.

---

<div class="post-metadata">

**Author:** ![srinim](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/srinim/32/62604_2.png) [@srinim](https://discuss.pytorch.org/u/srinim)\
**Post date:** [April 30, 2024, 2:52pm UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/3 "2024-04-30T14:52:09Z")

</div>

Following command solved the issue on my machine, I experianced the issue due to MKl version mismatch, latest torch installation getting me mkl which is interfering with mkl I have in my application.

python.exe -m pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 --index-url [https://download.pytorch.org/whl/cpu](https://download.pytorch.org/whl/cpu)

---

<div class="post-metadata">

**Author:** ![kirbaz](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/kirbaz/32/69768_2.png) [@kirbaz](https://discuss.pytorch.org/u/kirbaz)\
**Post date:** [May 5, 2024, 2:44pm UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/4 "2024-05-05T14:44:59Z")

</div>

Hello, I tried as you wrote in your comment. Nothing worked, I tried installing different versions of Torch, Torchaudio, Torchvision. The error remains the same: …Python311\site-packages\torch\lib\shm.dll" or one of its dependencies. Please tell me the solution. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![orionflame](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/orionflame/32/69785_2.png) [@orionflame](https://discuss.pytorch.org/u/orionflame)\
**Post date:** [May 6, 2024, 3:04pm UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/5 "2024-05-06T15:04:44Z")

</div>

i have the same issue today:  
pip3 install torch torchvision torchaudio --index-url [https://download.pytorch.org/whl/cu121](https://download.pytorch.org/whl/cu121)

I have cuda 12.1 on windows 11. is something broken on pytorch side?

---

<div class="post-metadata">

**Author:** ![Zain\_Mehdi](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/zain_mehdi/32/69805_2.png) [@Zain\_Mehdi](https://discuss.pytorch.org/u/Zain_Mehdi)\
**Post date:** [May 6, 2024, 3:10pm UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/6 "2024-05-06T15:10:08Z")

</div>

Installing pytorch separately using the guide here fixed it for me

> **[Start Locally](https://pytorch.org/get-started/locally/)**
>
> Start Locally

conda install pytorch torchvision torchaudio cpuonly -c pytorch

---

<div class="post-metadata">

**Author:** ![orionflame](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/orionflame/32/69785_2.png) [@orionflame](https://discuss.pytorch.org/u/orionflame)\
**Post date:** [May 6, 2024, 3:29pm UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/7 "2024-05-06T15:29:51Z")

</div>

that looks like CPU only though. I need GPU support.

---

<div class="post-metadata">

**Author:** ![srinim](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/srinim/32/62604_2.png) [@srinim](https://discuss.pytorch.org/u/srinim)\
**Post date:** [May 6, 2024, 3:50pm UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/9 "2024-05-06T15:50:08Z")

</div>

select options in following link for GPU support

> **[Start Locally](https://pytorch.org/get-started/locally/)**
>
> Start Locally

---

<div class="post-metadata">

**Author:** ![AlphaBetaGamma96](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@AlphaBetaGamma96](https://discuss.pytorch.org/u/AlphaBetaGamma96)\
**Post date:** [May 6, 2024, 3:58pm UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/10 "2024-05-06T15:58:35Z")

</div>

Following on from @Alexander_DE’s reply, you should be able to resolve the issue by installing PyTorch2.2 instead of the current latest version 2.3.

The previous install commands can be found on: [Previous PyTorch Versions | PyTorch](https://pytorch.org/get-started/previous-versions/)

More information on debugging this issue can be found on this thread here: [Cuda not available for RTX 6000 mobile - #9 by AlphaBetaGamma96](https://discuss.pytorch.org/t/cuda-not-available-for-rtx-6000-mobile/202160/9)

---

<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:** [May 6, 2024, 4:26pm UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/11 "2024-05-06T16:26:56Z")

</div>

Cross-posting also [the GitHub issue](https://discuss.pytorch.org/t/cuda-not-available-for-rtx-6000-mobile/202160/12) tracking it.

---

<div class="post-metadata">

**Author:** ![kirbaz](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/kirbaz/32/69768_2.png) [@kirbaz](https://discuss.pytorch.org/u/kirbaz)\
**Post date:** [May 10, 2024, 4:50am UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/12 "2024-05-10T04:50:08Z")

</div>

Hello! I solved this problem. Add env path …\AppData\Roaming\Python\Library\bin\

---

<div class="post-metadata">

**Author:** ![chenming7777](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/chenming7777/32/70204_2.png) [@chenming7777](https://discuss.pytorch.org/u/chenming7777)\
**Post date:** [May 22, 2024, 3:38pm UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/13 "2024-05-22T15:38:50Z")

</div>

its not working… also changing the version to torch==2.2.2 cant even show have cuda

---

<div class="post-metadata">

**Author:** ![chenming7777](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/chenming7777/32/70204_2.png) [@chenming7777](https://discuss.pytorch.org/u/chenming7777)\
**Post date:** [May 22, 2024, 3:39pm UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/14 "2024-05-22T15:39:23Z")

</div>

help its not working as well

---

<div class="post-metadata">

**Author:** ![kerwin\_Zhou](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/kerwin_zhou/32/70205_2.png) [@kerwin\_Zhou](https://discuss.pytorch.org/u/kerwin_Zhou)\
**Post date:** [May 22, 2024, 4:52pm UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/15 "2024-05-22T16:52:28Z")

</div>

Thnaks, I solved it with your suggestion.

---

<div class="post-metadata">

**Author:** ![SilverGreen93](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/silvergreen93/32/71363_2.png) [@SilverGreen93](https://discuss.pytorch.org/u/SilverGreen93)\
**Post date:** [July 11, 2024, 3:42pm UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/16 "2024-07-11T15:42:58Z")

</div>

So I had this problem also, version 2.2.1 works, but version 2.3.0 does not.  
Is this a bug that needs fixing? What is the root cause of this? I want to keep my packages updated and there are some dependencies that will require to keep up with the latest.

---

<div class="post-metadata">

**Author:** ![rohan1](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/rohan1/32/69425_2.png) [@rohan1](https://discuss.pytorch.org/u/rohan1)\
**Post date:** [July 18, 2024, 9:06am UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/17 "2024-07-18T09:06:52Z")

</div>

thanks after countless hours your suggestion worked

---

<div class="post-metadata">

**Author:** ![Rishabh\_Kausish](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/rishabh_kausish/32/71777_2.png) [@Rishabh\_Kausish](https://discuss.pytorch.org/u/Rishabh_Kausish)\
**Post date:** [July 28, 2024, 3:18pm UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/18 "2024-07-28T15:18:09Z")

</div>

Faced the same issue.

Resolved it using:

pip install torch==2.2.0 torchvision==0.17.0 torchaudio==2.2.0

---

<div class="post-metadata">

**Author:** ![Tai\_Ph\_m\_t\_n](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/tai_ph_m_t_n/32/71965_2.png) [@Tai\_Ph\_m\_t\_n](https://discuss.pytorch.org/u/Tai_Ph_m_t_n)\
**Post date:** [August 7, 2024, 6:32am UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/19 "2024-08-07T06:32:27Z")

</div>

Thnaks, I solved it with your suggestion

---

<div class="post-metadata">

**Author:** ![Joseph1](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/joseph1/32/71982_2.png) [@Joseph1](https://discuss.pytorch.org/u/Joseph1)\
**Post date:** [August 7, 2024, 4:23pm UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/20 "2024-08-07T16:23:31Z")

</div>

thank you, your method worked for me

---

<div class="post-metadata">

**Author:** ![Binayak\_Koirala](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/binayak_koirala/32/72339_2.png) [@Binayak\_Koirala](https://discuss.pytorch.org/u/Binayak_Koirala)\
**Post date:** [August 25, 2024, 5:06am UTC](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695/21 "2024-08-25T05:06:15Z")

</div>

Thank you dude for solving my 5 hrs issue. Hope you have a great time ahead.

[Next page](https://discuss.pytorch.org/t/error-loading-lib-site-packages-torch-lib-shm-dll-or-one-of-its-dependencie/201695.md?page=2)
