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

Windows系统安装Poetry报错:.Content was unexpected at this time

解决Windows安装Poetry报错.Content was unexpected at this time.

问题场景

在Windows系统中执行Poetry官方提供的安装命令:

(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -

此前能正常运行,现在触发错误:

C:\Project_Files\project>(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
.Content was unexpected at this time.

解决方法

  • 检查终端类型:该命令是PowerShell专属语法,如果在CMD(命令提示符)中执行会出现此错误,必须切换到PowerShell环境。
  • 切换终端重新执行:
    1. 按下Win + X,选择「Windows PowerShell」或「终端」(Windows 11及以上版本)。
    2. 直接复制执行官方安装命令即可。
  • 替代安装步骤(若直接执行命令仍有问题):
    1. 单独下载安装脚本:
      Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing -OutFile install-poetry.py
      
    2. 运行脚本完成安装:
      py install-poetry.py
      

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.17 15:40:21