我已经安装了python3.12,1并在venv中工作.

点位在23.3.2 SetupTools版本为69.0.3

安装grpcio-1.57.0时出现故障.输出如下所示.如有任何帮助,我们将不胜感激!

pip wheel --no-cache-dir --use-pep517 "grpcio (==1.57.0)"
Collecting grpcio==1.57.0
  Downloading grpcio-1.57.0.tar.gz (24.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 24.7/24.7 MB 110.8 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [26 lines of output]
      <string>:43: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      Traceback (most recent call last):
        File "/home/richard/headcoach/headCoach-backend/backend-1/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/richard/headcoach/headCoach-backend/backend-1/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/richard/headcoach/headCoach-backend/backend-1/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-6dp2h0u2/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-6dp2h0u2/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-6dp2h0u2/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-6dp2h0u2/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 292, in <module>
        File "<string>", line 226, in check_linker_need_libatomic
        File "/usr/lib/python3.12/subprocess.py", line 1026, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "/usr/lib/python3.12/subprocess.py", line 1950, in _execute_child
          raise child_exception_type(errno_num, err_msg, err_filename)
      FileNotFoundError: [Errno 2] No such file or directory: 'c++'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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

我已经在谷歌上搜索了这个问题,根据一些消息来源,这不应该发生在我使用的pip和setuptools版本中.

推荐答案

您try 安装的版本grpcio 1.57.0不支持python3.12.1.您可以 Select 支持python3.12的install the stable release (grpcio 1.60.0),也可以将您的python3.11版本降级为3.11,以使用该包的旧版本.

Python-3.x相关问答推荐

像计数不显示在html和想知道如果我的模型设置正确

Numba编译时间呈指数级增长--可以像C编译器一样配置优化级别吗?

错误:无法为 pyconcorde 构建轮子,这是安装基于 pyproject.toml 的项目所必需的

Python - 根据条件附加 NULL 值

在一行中读写一个csv文件

通过匹配第一列的行值,逐个单元格地添加两个Pandas 数据框中的浮点数

为什么 mypy 不适用于 sqlalchemy?

SMTP 库 Python3:不太安全的应用程序访问

在不使用字符串方法的情况下查找字符串最后一个单词的长度 - Python

获取比较多列的最大值并返回特定值

ValueError:FixedLocator 位置的数量 (5),通常来自对 set_ticks 的调用,与刻度标签的数量 (12) 不匹配

python total_ordering:为什么使用 __lt__ 和 __eq__ 而不是 __le__?

如何在 Python3 中添加带有标志的命令行参数?

导入 python 模块而不实际执行它

AttributeError:LinearRegression 对象没有属性coef_

如何在不使用 @hydra.main() 的情况下获取 Hydra 配置

如何使用 d.items() 更改 for 循环中的所有字典键?

为什么排序列表比未排序列表大

如何在 Pandas 中的超 Big Data 框上创建数据透视表

Beautifulsoup 的单元测试失败