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

Windows 10环境下localstack 0.12.18安装失败求助

解决LocalStack 0.12.18在Windows 10 Enterprise下的UnicodeDecodeError安装问题

这个错误的核心原因是Windows命令行默认采用CP1252编码,而LocalStack源码包中的文件使用UTF-8编码,导致安装过程中解码失败。以下是几种可行的解决方案:

  • 临时设置Python编码环境变量
    在执行安装命令前,先强制Python使用UTF-8编码处理文件:

    set PYTHONUTF8=1
    pip install C:\Users\me\Downloads\localstack-0.12.18.tar.gz --trusted-host pypi.org --trusted-host files.pythonhosted.org
    
  • 永久配置Python编码(可选)
    若不想每次手动设置,可通过系统环境变量永久生效:

    1. 右键「此电脑」→「属性」→「高级系统设置」→「环境变量」
    2. 在「系统变量」区域点击「新建」,变量名填PYTHONUTF8,变量值填1
    3. 重启终端后重新执行安装命令
  • 改用预编译wheel包安装
    直接从PyPI下载LocalStack 0.12.18的.whl格式预编译包,避免源码编译过程中的编码问题:

    pip install C:\Users\me\Downloads\localstack-0.12.18-py3-none-any.whl --trusted-host pypi.org --trusted-host files.pythonhosted.org
    

    注:该版本提供的py3-none-any.whl包兼容所有Python 3版本,包括你的Python 3.9.0。

  • 在conda环境中指定编码安装
    激活你的conda环境后再设置编码并执行安装:

    conda activate python390
    set PYTHONUTF8=1
    pip install C:\Users\me\Downloads\localstack-0.12.18.tar.gz --trusted-host pypi.org --trusted-host files.pythonhosted.org
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.26 14:42:39