We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
pip install failure for Python 3.10
## 🐛 Bug

pip fails to install required dependencies

### To Reproduce

Steps to reproduce the behavior:

```shell
 % 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


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/env python
2 import glob
3 import os
4 from functools import partial
5 from importlib.util import module_from_spec, spec_from_file_location
6 from typing import Tuple
7 
8 from setuptools import find_packages, setup
9 
10 _PATH_ROOT = os.path.realpath(os.path.dirname(__file__))
11 _PATH_REQUIRE = os.path.join(_PATH_ROOT, "requirements")
12 
13 
14 def _load_py_module(fname, pkg="torchmetrics"):
15     spec = spec_from_file_location(os.path.join(pkg, fname), os.path.join(_PATH_ROOT, pkg, fname))
16     py = module_from_spec(spec)
17     spec.loader.exec_module(py)
18     return py
19 
20 
21 about = _load_py_module("__about__.py")
22 setup_tools = _load_py_module("setup_tools.py")
23 long_description = setup_tools._load_readme_description(
24     _PATH_ROOT,
25     homepage=about.__homepage__,
26     version=f"v{about.__version__}",
27 )
28 
29 
30 BASE_REQUIREMENTS = setup_tools._load_requirements(path_dir=_PATH_ROOT, file_name="requirements.txt")
31 
32 
33 def _prepare_extras(skip_files: Tuple[str] = ("devel.txt")):
34     # find all extra requirements
35     _load_req = partial(setup_tools._load_requirements, path_dir=_PATH_REQUIRE)
36     found_req_files = sorted(os.path.basename(p) for p in glob.glob(os.path.join(_PATH_REQUIRE, "*.txt")))
37     # filter unwanted files
38     found_req_files = [n for n in found_req_files if n not in skip_files]
39     found_req_names = [os.path.splitext(req)[0] for req in found_req_files]
40     # define basic and extra extras
41     extras_req = {
42         name: _load_req(file_name=fname) for name, fname in zip(found_req_names, found_req_files) if "_test" not in name
43     }
44     for name, fname in zip(found_req_names, found_req_files):
45         if "_test" in name:
46             extras_req["test"] += _load_req(file_name=fname)
47     # filter the uniques
48     extras_req = {n: list(set(req)) for n, req in extras_req.items()}
49     # create an 'all' keyword that install all possible denpendencies
50     extras_req["all"] = [pkg for reqs in extras_req.values() for pkg in reqs]
51     return extras_req
52 
53 
54 # https://packaging.python.org/discussions/install-requires-vs-requirements /
55 # keep the meta-data here for simplicity in reading this file... it's not obvious
56 # what happens and to non-engineers they won't know to look in init ...
57 # the goal of the project is simplicity for researchers, don't want to add too much
58 # engineer specific practices
59 setup(
60     name="torchmetrics",
61     version=about.__version__,
62     description=about.__docs__,
63     author=about.__author__,
64     author_email=about.__author_email__,
65     url=about.__homepage__,
66     download_url=os.path.join(about.__homepage__, "archive", "master.zip"),
67     license=about.__license__,
68     packages=find_packages(exclude=["tests", "tests.*", "docs"]),
69     long_description=long_description,
70     long_description_content_type="text/markdown",
71     include_package_data=True,
72     zip_safe=False,
73     keywords=["deep learning", "machine learning", "pytorch", "metrics", "AI"],
74     python_requires=">=3.6",
75     setup_requires=[],
76     install_requires=BASE_REQUIREMENTS,
77     extras_require=_prepare_extras(),
78     project_urls={
79         "Bug Tracker": os.path.join(about.__homepage__, "issues"),
80         "Documentation": "https://torchmetrics.rtfd.io/en/latest/",
81         "Source Code": about.__homepage__,
82     },
83     classifiers=[
84         "Environment :: Console",
85         "Natural Language :: English",
86         # How mature is this project? Common values are
87         #   3 - Alpha, 4 - Beta, 5 - Production/Stable
88         "Development Status :: 5 - Production/Stable",
89         # Indicate who your project is intended for
90         "Intended Audience :: Developers",
91         "Topic :: Scientific/Engineering :: Artificial Intelligence",
92         "Topic :: Scientific/Engineering :: Image Recognition",
93         "Topic :: Scientific/Engineering :: Information Analysis",
94         # Pick your license as you wish
95         "License :: OSI Approved :: Apache Software License",
96         "Operating System :: OS Independent",
97         # Specify the Python versions you support here. In particular, ensure
98         # that you indicate whether you support Python 2, Python 3 or both.
99         "Programming Language :: Python :: 3",
100         "Programming Language :: Python :: 3.6",
101         "Programming Language :: Python :: 3.7",
102         "Programming Language :: Python :: 3.8",
103         "Programming Language :: Python :: 3.9",
104         "Programming Language :: Python :: 3.10",
105     ],
106 )
107
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -101,6 +101,5 @@
         "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
-        "Programming Language :: Python :: 3.10",
     ],
 )

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -101,6 +101,5 @@\n         \"Programming Language :: Python :: 3.7\",\n         \"Programming Language :: Python :: 3.8\",\n         \"Programming Language :: Python :: 3.9\",\n-        \"Programming Language :: Python :: 3.10\",\n     ],\n )\n", "issue": "pip install failure for Python 3.10\n## \ud83d\udc1b Bug\r\n\r\npip fails to install required dependencies\r\n\r\n### To Reproduce\r\n\r\nSteps to reproduce the behavior:\r\n\r\n```shell\r\n % python --version\r\nPython 3.10.2\r\n % pip freeze\r\n % pip install torchmetrics\r\nCollecting torchmetrics\r\n  Using cached torchmetrics-0.7.0-py3-none-any.whl (396 kB)\r\n  Using cached torchmetrics-0.6.2-py3-none-any.whl (332 kB)\r\n  Using cached torchmetrics-0.6.1-py3-none-any.whl (332 kB)\r\n  Using cached torchmetrics-0.6.0-py3-none-any.whl (329 kB)\r\n  Using cached torchmetrics-0.5.1-py3-none-any.whl (282 kB)\r\n  Using cached torchmetrics-0.5.0-py3-none-any.whl (272 kB)\r\n  Using cached torchmetrics-0.4.1-py3-none-any.whl (234 kB)\r\n  Using cached torchmetrics-0.3.2-py3-none-any.whl (274 kB)\r\n  Using cached torchmetrics-0.3.1-py3-none-any.whl (271 kB)\r\n  Using cached torchmetrics-0.3.0-py3-none-any.whl (270 kB)\r\n  Using cached torchmetrics-0.2.0-py3-none-any.whl (176 kB)\r\nERROR: 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.\r\n\r\nThe conflict is caused by:\r\n    torchmetrics 0.7.0 depends on torch>=1.3.1\r\n    torchmetrics 0.6.2 depends on torch>=1.3.1\r\n    torchmetrics 0.6.1 depends on torch>=1.3.1\r\n    torchmetrics 0.6.0 depends on torch>=1.3.1\r\n    torchmetrics 0.5.1 depends on torch>=1.3.1\r\n    torchmetrics 0.5.0 depends on torch>=1.3.1\r\n    torchmetrics 0.4.1 depends on torch>=1.3.1\r\n    torchmetrics 0.3.2 depends on torch>=1.3.1\r\n    torchmetrics 0.3.1 depends on torch>=1.3.1\r\n    torchmetrics 0.3.0 depends on torch>=1.3.1\r\n    torchmetrics 0.2.0 depends on torch>=1.3.1\r\n\r\nTo fix this you could try to:\r\n1. loosen the range of package versions you've specified\r\n2. remove package versions to allow pip attempt to solve the dependency conflict\r\n\r\nERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies\r\n```\r\n\r\n### Expected behavior\r\n\r\n`pip` instals all dependencies itself and then installs `torchmetrics`.\r\n\r\n### Environment\r\n\r\n- PyTorch Version (e.g., 1.0): No\r\n- OS (e.g., Linux): Ubuntu 21.10\r\n- How you installed PyTorch (`conda`, `pip`, source): pip\r\n- Build command you used (if compiling from source): pip install torchmetrics\r\n- Python version: 3.10.2\r\n\n", "before_files": [{"content": "#!/usr/bin/env python\nimport glob\nimport os\nfrom functools import partial\nfrom importlib.util import module_from_spec, spec_from_file_location\nfrom typing import Tuple\n\nfrom setuptools import find_packages, setup\n\n_PATH_ROOT = os.path.realpath(os.path.dirname(__file__))\n_PATH_REQUIRE = os.path.join(_PATH_ROOT, \"requirements\")\n\n\ndef _load_py_module(fname, pkg=\"torchmetrics\"):\n    spec = spec_from_file_location(os.path.join(pkg, fname), os.path.join(_PATH_ROOT, pkg, fname))\n    py = module_from_spec(spec)\n    spec.loader.exec_module(py)\n    return py\n\n\nabout = _load_py_module(\"__about__.py\")\nsetup_tools = _load_py_module(\"setup_tools.py\")\nlong_description = setup_tools._load_readme_description(\n    _PATH_ROOT,\n    homepage=about.__homepage__,\n    version=f\"v{about.__version__}\",\n)\n\n\nBASE_REQUIREMENTS = setup_tools._load_requirements(path_dir=_PATH_ROOT, file_name=\"requirements.txt\")\n\n\ndef _prepare_extras(skip_files: Tuple[str] = (\"devel.txt\")):\n    # find all extra requirements\n    _load_req = partial(setup_tools._load_requirements, path_dir=_PATH_REQUIRE)\n    found_req_files = sorted(os.path.basename(p) for p in glob.glob(os.path.join(_PATH_REQUIRE, \"*.txt\")))\n    # filter unwanted files\n    found_req_files = [n for n in found_req_files if n not in skip_files]\n    found_req_names = [os.path.splitext(req)[0] for req in found_req_files]\n    # define basic and extra extras\n    extras_req = {\n        name: _load_req(file_name=fname) for name, fname in zip(found_req_names, found_req_files) if \"_test\" not in name\n    }\n    for name, fname in zip(found_req_names, found_req_files):\n        if \"_test\" in name:\n            extras_req[\"test\"] += _load_req(file_name=fname)\n    # filter the uniques\n    extras_req = {n: list(set(req)) for n, req in extras_req.items()}\n    # create an 'all' keyword that install all possible denpendencies\n    extras_req[\"all\"] = [pkg for reqs in extras_req.values() for pkg in reqs]\n    return extras_req\n\n\n# https://packaging.python.org/discussions/install-requires-vs-requirements /\n# keep the meta-data here for simplicity in reading this file... it's not obvious\n# what happens and to non-engineers they won't know to look in init ...\n# the goal of the project is simplicity for researchers, don't want to add too much\n# engineer specific practices\nsetup(\n    name=\"torchmetrics\",\n    version=about.__version__,\n    description=about.__docs__,\n    author=about.__author__,\n    author_email=about.__author_email__,\n    url=about.__homepage__,\n    download_url=os.path.join(about.__homepage__, \"archive\", \"master.zip\"),\n    license=about.__license__,\n    packages=find_packages(exclude=[\"tests\", \"tests.*\", \"docs\"]),\n    long_description=long_description,\n    long_description_content_type=\"text/markdown\",\n    include_package_data=True,\n    zip_safe=False,\n    keywords=[\"deep learning\", \"machine learning\", \"pytorch\", \"metrics\", \"AI\"],\n    python_requires=\">=3.6\",\n    setup_requires=[],\n    install_requires=BASE_REQUIREMENTS,\n    extras_require=_prepare_extras(),\n    project_urls={\n        \"Bug Tracker\": os.path.join(about.__homepage__, \"issues\"),\n        \"Documentation\": \"https://torchmetrics.rtfd.io/en/latest/\",\n        \"Source Code\": about.__homepage__,\n    },\n    classifiers=[\n        \"Environment :: Console\",\n        \"Natural Language :: English\",\n        # How mature is this project? Common values are\n        #   3 - Alpha, 4 - Beta, 5 - Production/Stable\n        \"Development Status :: 5 - Production/Stable\",\n        # Indicate who your project is intended for\n        \"Intended Audience :: Developers\",\n        \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n        \"Topic :: Scientific/Engineering :: Image Recognition\",\n        \"Topic :: Scientific/Engineering :: Information Analysis\",\n        # Pick your license as you wish\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Operating System :: OS Independent\",\n        # Specify the Python versions you support here. In particular, ensure\n        # that you indicate whether you support Python 2, Python 3 or both.\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: 3.10\",\n    ],\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\nimport glob\nimport os\nfrom functools import partial\nfrom importlib.util import module_from_spec, spec_from_file_location\nfrom typing import Tuple\n\nfrom setuptools import find_packages, setup\n\n_PATH_ROOT = os.path.realpath(os.path.dirname(__file__))\n_PATH_REQUIRE = os.path.join(_PATH_ROOT, \"requirements\")\n\n\ndef _load_py_module(fname, pkg=\"torchmetrics\"):\n    spec = spec_from_file_location(os.path.join(pkg, fname), os.path.join(_PATH_ROOT, pkg, fname))\n    py = module_from_spec(spec)\n    spec.loader.exec_module(py)\n    return py\n\n\nabout = _load_py_module(\"__about__.py\")\nsetup_tools = _load_py_module(\"setup_tools.py\")\nlong_description = setup_tools._load_readme_description(\n    _PATH_ROOT,\n    homepage=about.__homepage__,\n    version=f\"v{about.__version__}\",\n)\n\n\nBASE_REQUIREMENTS = setup_tools._load_requirements(path_dir=_PATH_ROOT, file_name=\"requirements.txt\")\n\n\ndef _prepare_extras(skip_files: Tuple[str] = (\"devel.txt\")):\n    # find all extra requirements\n    _load_req = partial(setup_tools._load_requirements, path_dir=_PATH_REQUIRE)\n    found_req_files = sorted(os.path.basename(p) for p in glob.glob(os.path.join(_PATH_REQUIRE, \"*.txt\")))\n    # filter unwanted files\n    found_req_files = [n for n in found_req_files if n not in skip_files]\n    found_req_names = [os.path.splitext(req)[0] for req in found_req_files]\n    # define basic and extra extras\n    extras_req = {\n        name: _load_req(file_name=fname) for name, fname in zip(found_req_names, found_req_files) if \"_test\" not in name\n    }\n    for name, fname in zip(found_req_names, found_req_files):\n        if \"_test\" in name:\n            extras_req[\"test\"] += _load_req(file_name=fname)\n    # filter the uniques\n    extras_req = {n: list(set(req)) for n, req in extras_req.items()}\n    # create an 'all' keyword that install all possible denpendencies\n    extras_req[\"all\"] = [pkg for reqs in extras_req.values() for pkg in reqs]\n    return extras_req\n\n\n# https://packaging.python.org/discussions/install-requires-vs-requirements /\n# keep the meta-data here for simplicity in reading this file... it's not obvious\n# what happens and to non-engineers they won't know to look in init ...\n# the goal of the project is simplicity for researchers, don't want to add too much\n# engineer specific practices\nsetup(\n    name=\"torchmetrics\",\n    version=about.__version__,\n    description=about.__docs__,\n    author=about.__author__,\n    author_email=about.__author_email__,\n    url=about.__homepage__,\n    download_url=os.path.join(about.__homepage__, \"archive\", \"master.zip\"),\n    license=about.__license__,\n    packages=find_packages(exclude=[\"tests\", \"tests.*\", \"docs\"]),\n    long_description=long_description,\n    long_description_content_type=\"text/markdown\",\n    include_package_data=True,\n    zip_safe=False,\n    keywords=[\"deep learning\", \"machine learning\", \"pytorch\", \"metrics\", \"AI\"],\n    python_requires=\">=3.6\",\n    setup_requires=[],\n    install_requires=BASE_REQUIREMENTS,\n    extras_require=_prepare_extras(),\n    project_urls={\n        \"Bug Tracker\": os.path.join(about.__homepage__, \"issues\"),\n        \"Documentation\": \"https://torchmetrics.rtfd.io/en/latest/\",\n        \"Source Code\": about.__homepage__,\n    },\n    classifiers=[\n        \"Environment :: Console\",\n        \"Natural Language :: English\",\n        # How mature is this project? Common values are\n        #   3 - Alpha, 4 - Beta, 5 - Production/Stable\n        \"Development Status :: 5 - Production/Stable\",\n        # Indicate who your project is intended for\n        \"Intended Audience :: Developers\",\n        \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n        \"Topic :: Scientific/Engineering :: Image Recognition\",\n        \"Topic :: Scientific/Engineering :: Information Analysis\",\n        # Pick your license as you wish\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Operating System :: OS Independent\",\n        # Specify the Python versions you support here. In particular, ensure\n        # that you indicate whether you support Python 2, Python 3 or both.\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n    ],\n)\n", "path": "setup.py"}]}