# ImportError: libcusparseLt.so.0: cannot open shared object file: No such file or directory

**URL:** <https://discuss.pytorch.org/t/importerror-libcusparselt-so-0-cannot-open-shared-object-file-no-such-file-or-directory/190061>\
**Category:** vision\
**Created:** [October 16, 2023, 8:08pm UTC](https://discuss.pytorch.org/t/importerror-libcusparselt-so-0-cannot-open-shared-object-file-no-such-file-or-directory/190061 "2023-10-16T20:08:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atotem](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/a/e79b87/32.png) [@Atotem](https://discuss.pytorch.org/u/Atotem)\
**Post date:** [October 16, 2023, 8:08pm UTC](https://discuss.pytorch.org/t/importerror-libcusparselt-so-0-cannot-open-shared-object-file-no-such-file-or-directory/190061/1 "2023-10-16T20:08:49Z")

</div>

Hello,  
Recently I updated CUDA version to 12.2 in my machine (Ubuntu 22.04).

```auto
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.104.05 Driver Version: 535.104.05 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 4050 ... On | 00000000:01:00.0 On | N/A |
| N/A 37C P8 1W / 60W | 21MiB / 6141MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 2031 G /usr/bin/gnome-shell 1MiB |
+---------------------------------------------------------------------------------------+

```

I installed pytorch in a conda virtual environment using the latest version:  
`conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch-nightly -c nvidia`

And, when I try to run `import pytorch` I get the following error message:  
`ImportError: libcusparseLt.so.0: cannot open shared object file: No such file or directory`

So, I checked checking inside `/usr/local/cuda` with `find -name libcusparse*` and I effectively don’t have that file.

```auto
./targets/x86_64-linux/lib/libcusparse.so.12.1.2.141
./targets/x86_64-linux/lib/libcusparse_static.a
./targets/x86_64-linux/lib/libcusparse.so
./targets/x86_64-linux/lib/stubs/libcusparse.so
./targets/x86_64-linux/lib/libcusparse.so.12

```

So my question is, should I install that file from the following url: [cuSPARSELt Downloads | NVIDIA Developer](https://developer.nvidia.com/cusparselt-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_local) ? Or is this an issue from pytorch? I ask this because I have another conda environment where I can actually run `import torch` which I installed the 2023-09-25 by checking the list of conda revisions, without issues. However, if I run `torch.cuda.is_available()` I get `False`. Which is again weird because the first week of this month (October 2023) I didn’t have this issue. The only changes I remember are a package I installed via pip like pylabel. And I updated conda recently.

---

<div class="post-metadata">

**Author:** ![Atotem](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/a/e79b87/32.png) [@Atotem](https://discuss.pytorch.org/u/Atotem)\
**Post date:** [October 16, 2023, 8:14pm UTC](https://discuss.pytorch.org/t/importerror-libcusparselt-so-0-cannot-open-shared-object-file-no-such-file-or-directory/190061/2 "2023-10-16T20:14:52Z")

</div>

Complementing even more, I just found another conda environment which has the following version of pytorch:  
`pytorch 2.2.0.dev20230913 py3.8_cuda12.1_cudnn8.9.2_0 pytorch-nightly`

Which I installed the 2023-09-13, and when I run:

```auto
import torch
torch.cuda.is_available()

```

I get `True`. What’s causing this issue?

---

<div class="post-metadata">

**Author:** ![Atotem](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/a/e79b87/32.png) [@Atotem](https://discuss.pytorch.org/u/Atotem)\
**Post date:** [October 23, 2023, 2:20pm UTC](https://discuss.pytorch.org/t/importerror-libcusparselt-so-0-cannot-open-shared-object-file-no-such-file-or-directory/190061/3 "2023-10-23T14:20:24Z")

</div>

This week I did the same exercise and it’s working fine.

---

<div class="post-metadata">

**Author:** ![AHMAD\_WASEEM](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ahmad_waseem/32/72530_2.png) [@AHMAD\_WASEEM](https://discuss.pytorch.org/u/AHMAD_WASEEM)\
**Post date:** [September 23, 2024, 2:38pm UTC](https://discuss.pytorch.org/t/importerror-libcusparselt-so-0-cannot-open-shared-object-file-no-such-file-or-directory/190061/4 "2024-09-23T14:38:00Z")

</div>

I guess you need to install libcudasparseLt. Use this link: [https://developer.nvidia.com/cusparselt-downloads](https://developer.nvidia.com/cusparselt-downloads)

---

<div class="post-metadata">

**Author:** ![zenmixalot](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/zenmixalot/32/73002_2.png) [@zenmixalot](https://discuss.pytorch.org/u/zenmixalot)\
**Post date:** [September 26, 2024, 1:54am UTC](https://discuss.pytorch.org/t/importerror-libcusparselt-so-0-cannot-open-shared-object-file-no-such-file-or-directory/190061/5 "2024-09-26T01:54:18Z")

</div>

Installing cuda toolkit 11.7 fixed this for me.

> **[CUDA Toolkit 11.7 Downloads](https://developer.nvidia.com/cuda-11-7-0-download-archive)**

---

<div class="post-metadata">

**Author:** ![zrinaaa](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/zrinaaa/32/78084_2.png) [@zrinaaa](https://discuss.pytorch.org/u/zrinaaa)\
**Post date:** [August 29, 2025, 9:13pm UTC](https://discuss.pytorch.org/t/importerror-libcusparselt-so-0-cannot-open-shared-object-file-no-such-file-or-directory/190061/6 "2025-08-29T21:13:15Z")

</div>

Hi! I have encountered this same issue for a while now, and i can not seem to get rid of it. i did try installing libcudasparseLt from the link provided but that does not work either. Could you ultimately get this issue to work?

---

<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:** [August 29, 2025, 9:36pm UTC](https://discuss.pytorch.org/t/importerror-libcusparselt-so-0-cannot-open-shared-object-file-no-such-file-or-directory/190061/7 "2025-08-29T21:36:36Z")

</div>

Which PyTorch release are you using?

---

<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:** [September 24, 2025, 8:02pm UTC](https://discuss.pytorch.org/t/importerror-libcusparselt-so-0-cannot-open-shared-object-file-no-such-file-or-directory/190061/9 "2025-09-24T20:02:09Z")

</div>

I cannot reproduce any issue using PyTorch `2.6.0` and see the right `libcusparseLt.so` is opened from the pip wheel during `import torch`:

```auto
LD_DEBUG=libs python -c "import torch"
...
calling init: /usr/local/lib/python3.12/dist-packages/torch/lib/../../cusparselt/lib/libcusparseLt.so.0

```

Your repo link points to an SSO so you might want to remove it.
