Cannot install torchvision via poetry in windows
I succeeded in pytorch installation thanks to answers here
Poetry and PyTorch.
But, I'm still failed to install torchvision via poetry.
&gt; 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│                 &quot;Unable to find installation candidates for {}&quot;.format(package)
       74│             )
       75│
       76│         # Get the best link


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

I googled it and found some answers that say 'just pip install torchvision'.
But I'm suspicious that it works because according to PyPi(https://pypi.org/project/torchvision/#files), there is no wheel file for windows. And I tried it and it failed as I expected.
Is there any way to install latest torchvisin which is compatible with latest torch(1.7.1) in windows? + via poetry?


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.)
Add a URL dependency to your pyproject.toml file. For example I have torchvision 1.8.0 working with the following in my dependencies

[tool.poetry.dependencies]
python = &quot;^3.8&quot;
torch = {url = &quot;https://download.pytorch.org/whl/cu102/torch-1.8.0-cp38-cp38-win_amd64.whl&quot;}
torchvision = {url = &quot;https://download.pytorch.org/whl/cu102/torchvision-0.9.0-cp38-cp38-win_amd64.whl&quot;}


From your activated virtual environment do poetry update torchvision and you should be good to go.

