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

全新Windows10设备安装Poetry报错:No pyvenv.cfg file

解决Poetry安装失败(No pyvenv.cfg file)的方案

第一步:卸载微软商店版Python

  • 打开设置 → 应用 → 应用和功能,找到Python 3.8(来自Microsoft Store),点击卸载。

第二步:安装官方版Python 3.8

  • 下载Python 3.8的官方Windows可执行安装包(优先选3.8分支的稳定最终版,比如3.8.10)
  • 安装时必须勾选Add Python 3.8 to PATH,选择自定义安装并勾选“Install for all users”,避免权限和路径识别问题。

第三步:验证Python安装

  • 打开全新的PowerShell窗口,输入python --version,确认输出Python 3.8.x版本号;若不生效,尝试py -3.8 --version。

第四步:重新安装Poetry

  • 在PowerShell中执行安装命令:
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
  • 安装完成后,按照提示将Poetry的脚本路径(通常是C:\Users\[你的用户名]\AppData\Roaming\Python\Scripts)添加到系统环境变量,重启PowerShell生效。

额外排查点

  • 检查PowerShell执行策略:输入Get-ExecutionPolicy,若显示Restricted,执行Set-ExecutionPolicy RemoteSigned并按Y确认。
  • 暂时关闭杀毒软件,避免拦截安装脚本运行。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.08 06:40:37