无法通过pip安装grpc Python包的问题求助
手动安装gRPC Python包遇到的问题
问题背景
原本依赖构建脚本自动安装gRPC Python包,脚本持续失败后选择手动安装,执行pip3 install grpc时触发错误。
执行pip3 install grpc的错误输出
❯ pip3 install grpc Defaulting to user installation because normal site-packages is not writeable Collecting grpc Using cached grpc-1.0.0.tar.gz (5.2 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [6 lines of output] Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "/tmp/pip-install-_au3535m/grpc_0b2b1ce7560943288874cf94aa72394a/setup.py", line 33, in <module> raise RuntimeError(HINT) RuntimeError: Please install the official package with: pip install grpcio [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 grpcio,安装过程无异常完成 - 搜索关键词“setup.py egg_info did not run successfully”后,执行以下升级命令:
确认pip和setuptools均为最新版本,输出如下:pip install --upgrade pip pip install --upgrade setuptoolsDefaulting to user installation because normal site-packages is not writeable Requirement already satisfied: pip in /home/utl/.local/lib/python3.10/site-packages (24.0) Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: setuptools in /usr/local/lib/python3.10/dist-packages (69.5.1)
当前困境
再次执行pip install grpc仍出现相同错误,无法完成安装,寻求解决方案。
内容的提问来源于stack exchange,提问作者First User
相关产品推荐
相关产品推荐

