Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm trying to import and use ultralytics library in my Django rest framework project, I use poetry as my dependency manager, I installed ultralytics using poetry add ultralytics and on trying to import the library in my code I recieve this error

ValueError: libcublas.so.*[0-9] not found in the system path [my project and virtual environment paths]

how can I solve that?

like image 545
Mahmoud Aboelsoud Avatar asked Sep 03 '25 02:09

Mahmoud Aboelsoud


1 Answers

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
like image 79
Noumenon Avatar answered Sep 06 '25 09:09

Noumenon