You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Python 3.11.4环境下安装AWS EBcli失败求助

安装AWS EBcli在Python 3.11.4虚拟环境中失败,Python 3.8.10可正常安装

问题详情

  • 按官方步骤在Python 3.11.4的venv虚拟环境中安装AWS EBcli时,触发AttributeError: cython_sources错误,安装无法完成;但切换到Python 3.8.10的虚拟环境时,安装完全成功。
  • 已尝试官方故障排查指南中的依赖安装操作,无效果。
  • 搜索到包含相同错误的相关问题,但不清楚具体解决方式。

报错信息

File "/tmp/pip-build-env-yn_umd7x/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
  self.filelist.extend(build_ext.get_source_files())
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 201, in get_source_files
File "/tmp/pip-build-env-yn_umd7x/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
  raise AttributeError(attr)
AttributeError: cython_sources
[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.

解决方案

这个错误根源是EBcli依赖的旧版pyyaml不兼容Python 3.11——旧版pyyaml的构建脚本使用了setuptools已移除的cython_sources属性,导致构建失败。可以通过以下步骤解决:

  1. 先在Python 3.11.4的虚拟环境中安装兼容Python 3.11的pyyaml版本:
pip install pyyaml>=6.0.1
  1. 再执行EBcli的安装命令:
pip install awsebcli

或者直接在安装EBcli时指定兼容的pyyaml版本,一步完成:

pip install awsebcli pyyaml>=6.0.1

内容的提问来源于stack exchange,提问作者MartinPoncio

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 20:12:35