簡體   English   中英

無法在 windows 中通過詩歌安裝 torchvision

[英]Cannot install torchvision via poetry in windows

由於這里的答案Poetry 和 PyTorch ,我成功安裝了 pytorch

但是,我仍然無法通過詩歌安裝 torchvision。

> poetry add torchvision==0.8.2

Updating dependencies
Resolving dependencies...

Writing lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing torchvision (0.8.2)

  RuntimeError

  Unable to find installation candidates for torchvision (0.8.2)

  at ~\.poetry\lib\poetry\installation\chooser.py:72 in choose_for
       68│ 
       69│             links.append(link)
       70│
       71│         if not links:
    →  72│             raise RuntimeError(
       73│                 "Unable to find installation candidates for {}".format(package)
       74│             )
       75│
       76│         # Get the best link


Failed to add packages, reverting the pyproject.toml file to its original content.

我用谷歌搜索並找到了一些答案,上面寫着“只需pip install torchvision ”。 但我懷疑它是否有效,因為根據 PyPi( https://pypi.org/project/torchvision/#files ),沒有 windows 的 wheel 文件。我試過了,結果如我所料失敗了。

有什么方法可以安裝與 windows 中最新的 torch(1.7.1) 兼容的最新 torchvisin? + 通過詩歌?

  1. Look in https://download.pytorch.org/whl/torch_stable.html for the version you want to install (torchvision version, python version, CUDA version, OS etc.)
  2. 將 URL 依賴項添加到您的pyproject.toml文件中。 例如,我的依賴項中有 torchvision 1.8.0 使用以下內容
[tool.poetry.dependencies]
python = "^3.8"
torch = {url = "https://download.pytorch.org/whl/cu102/torch-1.8.0-cp38-cp38-win_amd64.whl"}
torchvision = {url = "https://download.pytorch.org/whl/cu102/torchvision-0.9.0-cp38-cp38-win_amd64.whl"}
  1. 從你激活的虛擬環境中poetry update torchvision ,你應該對go很好。

我遇到了同樣的問題,我只是重新打開終端並且一切正常。 我想我在一些錯誤的環境中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM