Ubuntu 22 server da bende kuramadım aynı hatayı alıyorum. bir kaç makaleye baktım ama cozende pek yok.

Collecting acme==0.21.1
  Using cached acme-0.21.1-py2.py3-none-any.whl (68 kB)
Collecting asgiref==3.2.3
  Using cached asgiref-3.2.3-py2.py3-none-any.whl (18 kB)
Collecting asn1crypto==0.24.0
  Using cached asn1crypto-0.24.0-py2.py3-none-any.whl (101 kB)
Collecting Babel==0.9.6
  Using cached Babel-0.9.6.zip (1.9 MB)
  Preparing metadata (setup.py) ... done
Collecting backports.ssl-match-hostname==3.5.0.1
  Using cached backports.ssl_match_hostname-3.5.0.1.tar.gz (5.6 kB)
  Preparing metadata (setup.py) ... done
Collecting bcrypt==3.1.7
  Using cached bcrypt-3.1.7-cp34-abi3-manylinux1_x86_64.whl (56 kB)
Collecting boto3==1.9.64
  Using cached boto3-1.9.64-py2.py3-none-any.whl (128 kB)
Collecting botocore==1.12.64
  Using cached botocore-1.12.64-py2.py3-none-any.whl (5.1 MB)
Collecting certifi==2018.4.16
  Using cached certifi-2018.4.16-py2.py3-none-any.whl (150 kB)
Collecting chardet==3.0.4
  Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting cloudflare==2.6.1
  Using cached cloudflare-2.6.1.tar.gz (59 kB)
  Preparing metadata (setup.py) ... done
Collecting ConfigArgParse==0.15.2
  Using cached ConfigArgParse-0.15.2.tar.gz (27 kB)
  Preparing metadata (setup.py) ... done
Collecting configobj==5.0.6
  Using cached configobj-5.0.6.tar.gz (33 kB)
  Preparing metadata (setup.py) ... done
Collecting cryptography==2.8
  Using cached cryptography-2.8-cp34-abi3-manylinux2010_x86_64.whl (2.3 MB)
Collecting decorator==3.4.0
  Using cached decorator-3.4.0.tar.gz (30 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      error in decorator setup command: use_2to3 is invalid.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

pip install --default-timeout=3600 -r /usr/local/requirments.txt has failed for 27 times
Wait for 3 seconds and try again...