Sanic installation fails

I have 3.10 python and 3.8 python and having pip version 19.3.1
in both python venv , i have pip.conf as below
[global]
target = /tmp/pip_packages

and when i install using pip install sanic==20.9.1
on 3.8 it installs correctly but on python 3.10 it fails with below stacktrace

File "/opt/conda/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 153, in _main
  status = self.run(options, args)
File "/opt/conda/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 446, in run
  installed = install_given_reqs(
File "/opt/conda/lib/python3.10/site-packages/pip/_internal/req/__init__.py", line 58, in install_given_reqs
  requirement.install(
File "/opt/conda/lib/python3.10/site-packages/pip/_internal/req/req_install.py", line 858, in install
  self.move_wheel_files(
File "/opt/conda/lib/python3.10/site-packages/pip/_internal/req/req_install.py", line 487, in move_wheel_files
  wheel.move_wheel_files(
File "/opt/conda/lib/python3.10/site-packages/pip/_internal/wheel.py", line 353, in move_wheel_files
  scheme = distutils_scheme(
File "/opt/conda/lib/python3.10/site-packages/pip/_internal/locations.py", line 118, in distutils_scheme
  assert not (home and prefix), "home={} prefix={}".format(home, prefix)

AssertionError: home=/tmp/pip-target-z8nrepa2 prefix=/tmp/pip-build-env-aqg2m8je/overlay

I upgraded pip but still it fails only error msg changed to below
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Collecting setuptools>=40
Using cached setuptools-67.7.2-py3-none-any.whl (1.1 MB)
Collecting wheel
Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
Installing collected packages: wheel, setuptools
ERROR: Cannot set --home and --prefix together
[end of output]

Need help to understand RCA why its failing in 3.10 only and not in 3.8, checked pip freeze for both all dependencies are same in 3.8 and 3.10

I’m not sure I can help. It doesn’t look like a Sanic issue. Have you tried in other machines? Or maybe in a docker container? What OS?