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

为何Poetry显示Python 3.11.4?如何指定使用^3.12版本?

问题原因与解决方法

原因解释

poetry debug info里的「Poetry」部分显示的Python版本,是Poetry自身运行所依赖的Python环境版本——这个版本由你当初安装Poetry时使用的Python决定,和系统全局Python、项目虚拟环境的版本没有关联。你现在看到的3.11.4,就是安装当前Poetry时用的Python版本。

解决步骤

要让Poetry使用Python 3.12.x版本,需要重新在3.12环境下安装Poetry:

  1. 卸载现有全局Poetry:
    curl -sSL https://install.python-poetry.org | python3 - --uninstall
    
  2. 确认当前终端的Python环境为3.12.x(通过pyenv切换后,执行python --version验证)
  3. 重新安装Poetry:
    curl -sSL https://install.python-poetry.org | python3 -
    
  4. 验证结果:执行poetry debug info,此时「Poetry」部分的Python版本会显示为3.12.x

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.24 17:27:35