Python 3.13 is unsupported

用户通过 uvx 工具运行 Open Interpreter(版本 v0.4.3),并显式指定使用 Python 3.13 解释器时触发编译失败。

Python 3.13 is unsupported

Python 3.13 is unsupported

快速结论:该报错发生在尝试使用 Open Interpreter 配合 Python 3.13 运行时,原因是其依赖的 tiktoken==0.7.0 通过 PyO3 构建时无法兼容 Python 3.13。优先降级到 Python 3.12 即可正常运行。

问题场景

用户通过 uvx 工具运行 Open Interpreter(版本 v0.4.3),并显式指定使用 Python 3.13 解释器时触发编译失败。

报错原文

❯ uvx --from open-interpreter --python 3.13 interpreter
  × Failed to download and build `tiktoken==0.7.0`
  ╰─▶ Build backend failed to build wheel through `build_wheel` (exit status: 1)

      ...

        --- stderr
        error: the configured Python interpreter version (3.13) is newer than PyO3's maximum supported version (3.12)
        = help: please check if an updated version of PyO3 is available. Current version: 0.20.3
        = help: set PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to suppress this check and build anyway using the stable ABI
      warning: build failed, waiting for other jobs to finish...
      error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release
      -v --features pyo3/extension-module --crate-type cdylib -- -C 'link-args=-undefined dynamic_lookup
      -Wl,-install_name,@rpath/_tiktoken.cpython-313-darwin.so'` failed with code 101

  help: `tiktoken` (v0.7.0) was included because `open-interpreter` (v0.4.3) depends on `tiktoken`

原因分析

可能原因:Open Interpreter v0.4.3 依赖的 tiktoken==0.7.0 通过 PyO3(版本 0.20.3)进行 Rust 绑定编译,而 PyO3 0.20.3 仅支持 Python 3.9–3.12,不支持 3.13。当系统 Python 为 3.13 时,构建 tiktoken 的 C 扩展模块会因此报错,导致整个项目安装失败。

Issue 评论区指出,tiktoken 0.7.0 即使对 Python 3.12 也存在兼容性问题,建议用户升级到 0.9.0 或更高版本。

此外,用户反馈中提出了解决方案:将项目的 pyproject.toml 中的 Python 版本限制改为 >=3.9,<3.13 可以避免此问题。

环境排查

  • 确认当前 Python 版本是否为 3.13(运行 python --version
  • 确认 Open Interpreter 版本(运行 interpreter --version
  • 确认系统是否已安装 Cargo / Rust 工具链(用于构建 tiktoken)
  • 检查 PyO3 版本(可选,在 tiktoken 构建失败时会打印)

解决步骤

  1. 降级到 Python 3.12(可优先尝试):使用 uvx 时指定 --python 3.12 参数,例如:
    uvx --from open-interpreter --python 3.12 interpreter
    如不使用 uvx,可创建 Python 3.12 虚拟环境后安装运行。
  2. 升级 tiktoken 版本:尝试在安装前手动升级 tiktoken 到 0.9.0 或更高版本,但这需要修改项目依赖(非官方支持,可能遇到其他兼容问题)。
  3. 设置环境变量绕过 PyO3 版本检查(不推荐用于生产)
    export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
    然后重新尝试使用 Python 3.13 安装。但这可能带来 ABI 不兼容风险。
  4. 等待上游修复:关注 Open Interpreter 仓库的后续更新,官方可能通过更新依赖或限制 Python 版本来修复此问题。

验证方法

运行 uvx --from open-interpreter --python 3.12 interpreter,若能正常启动交互式终端则不出现上述构建错误即可确认问题已解决。若需要验证 Python 版本,可在解释器中执行 import sys; print(sys.version) 确认版本为 3.12.x。

参考来源

OpenInterpreter/open-interpreter #1539

GamsGo AI

AI 工具推荐

想把多个 AI 模型放在一个入口?

GamsGo AI 集成 ChatGPT、DeepSeek、Gemini、Claude、Midjourney、Veo 等常用模型,适合写作、绘图、视频和日常 AI 工作流。

了解 GamsGo AI

推广链接:通过此链接购买,我可能获得佣金,不影响你的价格。

celebrityanime
celebrityanime
文章: 7821

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注