python-poetry / python-poetry/poetry
Packages not finding libraries
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Poetry commands and the equivalent pip commands in fresh folders, then compare the resulting environments. Inspect the provided Poetry configuration and the empty example pyproject.toml, focusing on why libcudnn.so.9 is not found from the Poetry environment. Done means identifying the environment or dependency-resolution difference and documenting a verified fix or clear reproduction details.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100