Skip to content

pip install failure for Python 3.10 #808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
inpefess opened this issue Jan 28, 2022 · 6 comments · Fixed by #810
Closed

pip install failure for Python 3.10 #808

inpefess opened this issue Jan 28, 2022 · 6 comments · Fixed by #810
Labels
bug / fix Something isn't working help wanted Extra attention is needed

Comments

@inpefess
Copy link

🐛 Bug

pip fails to install required dependencies

To Reproduce

Steps to reproduce the behavior:

 % python --version
Python 3.10.2
 % pip freeze
 % pip install torchmetrics
Collecting torchmetrics
  Using cached torchmetrics-0.7.0-py3-none-any.whl (396 kB)
  Using cached torchmetrics-0.6.2-py3-none-any.whl (332 kB)
  Using cached torchmetrics-0.6.1-py3-none-any.whl (332 kB)
  Using cached torchmetrics-0.6.0-py3-none-any.whl (329 kB)
  Using cached torchmetrics-0.5.1-py3-none-any.whl (282 kB)
  Using cached torchmetrics-0.5.0-py3-none-any.whl (272 kB)
  Using cached torchmetrics-0.4.1-py3-none-any.whl (234 kB)
  Using cached torchmetrics-0.3.2-py3-none-any.whl (274 kB)
  Using cached torchmetrics-0.3.1-py3-none-any.whl (271 kB)
  Using cached torchmetrics-0.3.0-py3-none-any.whl (270 kB)
  Using cached torchmetrics-0.2.0-py3-none-any.whl (176 kB)
ERROR: Cannot install torchmetrics==0.2.0, torchmetrics==0.3.0, torchmetrics==0.3.1, torchmetrics==0.3.2, torchmetrics==0.4.1, torchmetrics==0.5.0, torchmetrics==0.5.1, torchmetrics==0.6.0, torchmetrics==0.6.1, torchmetrics==0.6.2 and torchmetrics==0.7.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    torchmetrics 0.7.0 depends on torch>=1.3.1
    torchmetrics 0.6.2 depends on torch>=1.3.1
    torchmetrics 0.6.1 depends on torch>=1.3.1
    torchmetrics 0.6.0 depends on torch>=1.3.1
    torchmetrics 0.5.1 depends on torch>=1.3.1
    torchmetrics 0.5.0 depends on torch>=1.3.1
    torchmetrics 0.4.1 depends on torch>=1.3.1
    torchmetrics 0.3.2 depends on torch>=1.3.1
    torchmetrics 0.3.1 depends on torch>=1.3.1
    torchmetrics 0.3.0 depends on torch>=1.3.1
    torchmetrics 0.2.0 depends on torch>=1.3.1

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

Expected behavior

pip instals all dependencies itself and then installs torchmetrics.

Environment

  • PyTorch Version (e.g., 1.0): No
  • OS (e.g., Linux): Ubuntu 21.10
  • How you installed PyTorch (conda, pip, source): pip
  • Build command you used (if compiling from source): pip install torchmetrics
  • Python version: 3.10.2
@Borda
Copy link
Member

Borda commented Jan 28, 2022

I think the problem comes from PyTorch dependency as they have not officially released wheels for python 3.10 so for this python version you would need to compile PyTorch from the source... the binaries for python 3.10 are expected for PT 1.11

see: pytorch/pytorch#66424

@inpefess inpefess changed the title pip install failure pip install failure for Python 3.10 Jan 28, 2022
@inpefess
Copy link
Author

So, torchmetrics doesn't support Python 3.10 officially, although there is a badge claiming that on the front page. PyTorchLightning doesn't claim 3.10 support, for example, and torch documentation recommends using 3.6, 3.7, or 3.8.

I suggest either dropping the Python 3.10 support claim or adding specific 3.10 installation instructions to the documentation as a form of weak support.

@justusschock
Copy link
Member

@inpefess you are correct. For now, we certainly need to remove the badge.

@justusschock
Copy link
Member

@inpefess I opened a PR to fix this, the badge will only update after the next release. However, we want to wait with that one for all reviews. Are you fine with that? Can you install it with python <3.10?

@Borda
Copy link
Member

Borda commented Jan 28, 2022

@inpefess you are correct. For now, we certainly need to remove the badge.

torchmetrics does but Pytorch does not provide wheels for it so when PT releases we would have it but if we change the tag we can't add it back so it won't be correct in two months' time that TM does not support 3.10 when it does...

I suggest either dropping the Python 3.10 support claim or adding specific 3.10 installation instructions to the documentation as a form of weak support.

ok, I'll add docs for building TM with PT from source as this is not limitation of TM but PT

@inpefess
Copy link
Author

@inpefess I opened a PR to fix this, the badge will only update after the next release. However, we want to wait with that one for all reviews. Are you fine with that? Can you install it with python <3.10?

Sure, I've already done that! Thank you.

ok, I'll add docs for building TM with PT from source as this is not limitation of TM but PT

Yes, I think it's not a question of tags but the documentation. If it mentions that for Python 3.10, one should use Anaconda, no one will probably try doing something like I did. But I noticed the badge, executed the first line from the docs, and failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug / fix Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants