诗歌添加火炬出现错误:无法找到 nvidia-cudnn-cu11 的安装候选

Vin*_*aes 6 torch python-poetry

在 mac m1 蒙特利上运行

\n

在干净的环境中安装带有诗歌的火炬会给我带来以下运行时错误:

\n
\xe2\x9c\x97 python --version    \nPython 3.8.13\n\n\xe2\x9c\x97 poetry --version\nPoetry (version 1.2.2)\n\n\xe2\x9c\x97 poetry add torch\nUsing version ^1.13.0 for torch\n\nUpdating dependencies\nResolving dependencies... (0.1s)\n\nPackage operations: 5 installs, 0 updates, 0 removals\n\n  \xe2\x80\xa2 Installing nvidia-cublas-cu11 (11.10.3.66): Pending...\n  \xe2\x80\xa2 Installing nvidia-cuda-nvrtc-cu11 (11.7.99): Failed\n\n  RuntimeError\n\n  \xe2\x80\xa2 Installing nvidia-cuda-nvrtc-cu11 (11.7.99): Failed\n\n  RuntimeError\n\n  \xe2\x80\xa2 Installing nvidia-cublas-cu11 (11.10.3.66): Failed\n  \xe2\x80\xa2 Installing nvidia-cuda-nvrtc-cu11 (11.7.99): Failed\n\n\n  \xe2\x80\xa2 Installing nvidia-cudnn-cu11 (8.5.0.96): Failed\n\n  RuntimeError\n\n  Unable to find installation candidates for nvidia-cudnn-cu11 (8.5.0.96)\n\n  at ~/Library/Application Support/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/chooser.py:103 in choose_for\n       99\xe2\x94\x82 \n      100\xe2\x94\x82             links.append(link)\n      101\xe2\x94\x82 \n      102\xe2\x94\x82         if not links:\n    \xe2\x86\x92 103\xe2\x94\x82             raise RuntimeError(f"Unable to find installation candidates for {package}")\n      104\xe2\x94\x82 \n      105\xe2\x94\x82         # Get the best link\n      106\xe2\x94\x82         chosen = max(links, key=lambda link: self._sort_key(package, link))\n      107\xe2\x94\x82 \n
Run Code Online (Sandbox Code Playgroud)\n

使用 pip 安装没有任何问题:

\n
\xe2\x9c\x97 pip install torch        \nCollecting torch\n  Downloading torch-1.13.0-cp38-none-macosx_11_0_arm64.whl (55.3 MB)\n     \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 55.3/55.3 MB 3.0 MB/s eta 0:00:00\nRequirement already satisfied: typing-extensions in /Users/vincent/Library/Caches/pypoetry/virtualenvs/recommend-drawify-iwMS_JJ1-py3.8/lib/python3.8/site-packages (from torch) (4.4.0)\nInstalling collected packages: torch\nSuccessfully installed torch-1.13.0\n
Run Code Online (Sandbox Code Playgroud)\n

我使用官方文档安装了诗歌:https://python-poetry.org/docs/#installation

\n

Azi*_*bro 4

这是一个已知问题,尚无解决方案。您可以在这里追踪:

https://github.com/python-poetry/poetry/issues/6939