poetry icon indicating copy to clipboard operation
poetry copied to clipboard

Packages not finding libraries

Open MrSampson opened this issue 9 months ago • 2 comments

Description

I really don't know how to describe what's going on, but libraries in the site-packages folder are not being found when using poetry 2.1

Using a new folder: poetry add torch transformers ipython -- assuming the pyproject.toml points to the correct directory for Pytorch

Using ipython:

from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("distilbert/distilbert-base-uncased")

results in the following error: ImportError: libcudnn.so.9: cannot open shared object file: No such file or directory

but the file is definitely in .venv/lib/python3.13/site-packages/nvidia/cudnn/lib/libcudnn.so.9.

Whereas if I use the equivalent commands with pip in a different new folder

source .venv/bin/activate
pip install torch  --index-url https://download.pytorch.org/whl/cu126
pip install transformers ipython

and execute the Tokenizer commands in ipython, all is well.

What could be going on here?

Workarounds

I've switched to pip.

Poetry Installation Method

pipx

Operating System

Fedora 41

Poetry Version

Poetry (version 2.1.0)

Poetry Configuration

cache-dir = "/home/<removed>/.cache/pypoetry"
data-dir = "/home/<removed>/.local/share/pypoetry"
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
installer.parallel = true
installer.re-resolve = true
keyring.enabled = true
python.installation-dir = "{data-dir}/python"  # /home/<removed>/.local/share/pypoetry/python
repositories.torch.url = "https://download.pytorch.org/whl/cu126"
requests.max-retries = 0
solver.lazy-wheel = true
system-git-client = false
virtualenvs.create = true
virtualenvs.in-project = true
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /home/<removed>/.cache/pypoetry/virtualenvs
virtualenvs.prompt = "{project_name}-py{python_version}"
virtualenvs.use-poetry-python = false

Python Sysconfig

sysconfig.log
Paste the output of 'python -m sysconfig', over this line.

Example pyproject.toml


Poetry Runtime Logs

poetry-runtime.log
Paste the output of 'poetry -vvv <command>', over this line.

MrSampson avatar Mar 08 '25 12:03 MrSampson

duplicate #9635, #9291

no reason to think there is a poetry bug here - but the reporters do not seem to have explained what, if anything, they understood.

If and when you figure it out, do leave an update for the next person.

dimbleby avatar Mar 08 '25 13:03 dimbleby

Sorry about the duplicate. I guess my Google Fu wasn't up for the task.

MrSampson avatar Mar 08 '25 13:03 MrSampson