'Install grpcio via pip: "legacy-install-failure"

I want to install grpcio with pip(version 1.35). But I get this error:

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> grpcio

I tried to install python-dev or wheel, but it did not work.

My python version = 3.10

Ubuntu = 22.04



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source