[Django]-ValueError: libcublas.so.*[0-9] not found in the system path

59πŸ‘

Update: this issue was fixed in PyTorch 2.1.1.

Since May 9 2023 there is an open issue with PyTorch 2.0.1 and 2.1.0 causing poetry lock to delete libcublas from poetry.lock. Their wheel contains the dependency, but their PyPi upload did not get it.

A workaround would be to skip these versions in pyproject.toml (typically under [tool.poetry.dependencies]):

torch = ">=2.0.0, !=2.0.1, !=2.1.0"

Make sure to run the following to correctly update your poetry env after making the change

poetry lock --no-update
poetry install
πŸ‘€Noumenon

2πŸ‘

You have to install cuda on your system.

E.g. on ubuntu:

sudo apt-get install nvidia-cuda-toolkit nvidia-cuda-toolkit-gcc
πŸ‘€Sven

1πŸ‘

If you come here and have this problem with some other library while using poetry, try to install it directly in .venv. For me that was:

   pip3 install "transformers[torch]"
πŸ‘€TojaQl

0πŸ‘

according to this response :

https://github.com/pytorch/pytorch/issues/100974#issuecomment-1541856571

you can also install the nvidia-* dependencies specifically,
in your poetry venv / pyproject.toml

πŸ‘€s4mdf0o1

0πŸ‘

add this to pyproject.toml

torch = ">=2.0.0, !=2.0.1, !=2.1.0"

poetry install

THIS WORKS

ok im not exactly sure how it works. I checked my history I’m still confused but when the correct version is selected you should see poetry install would install a bunch of nvidia libraries. after that when I run my script it works perfectly

πŸ‘€stackerlacker

0πŸ‘

add this to pyproject.toml

torch = ">=2.0.0, !=2.0.1, !=2.1.0"

poetry lock --no-update

poetry install

πŸ‘€KARTHIK MVP

0πŸ‘

What caused the issue in my case was deleting .local folder where local library files are usually stored. I uninstalled torch and did a conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia which removed the error and was the beginning of the solution.

Leave a comment