python / python/cpython

`freeze.py` doesn't work on Windows

未关闭
#132,225 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

OS-windows type-bug
主要语言
Python
星标
77.2k
派生
35.9k
PR 合并指标
PR 指标待抓取

描述

Bug report

Bug description:

I tried to run freeze.py under the README instructions here.

# Assumed I was in the Python source tree root
python .\Tools\freeze\freeze.py -p . -o hello  .\PCbuild\amd64\tests\hello.py

It did generate lots of .c source files. But when I ran nmake to generate the target, it complained as follows

Microsoft (R) Program Maintenance Utility Version 14.43.34809.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        if not exist Build\Release\. mkdir Build\Release
NMAKE : fatal error U1073: don't know how to make '".\Python\frozenmain.c"'
Stop.

It looks like it could not find the correct Python path. Then I tried ran the command without the output directory option

python .\Tools\freeze\freeze.py -p .  .\PCbuild\amd64\tests\hello.py

And ran nmake. It complained as follows

Microsoft (R) Program Maintenance Utility Version 14.43.34809.0
Copyright (C) Microsoft Corporation.  All rights reserved.

frozenmain.c
./Include\Python.h(14): fatal error C1083: Cannot open include file: 'pyconfig.h': No such file or directory
NMAKE : fatal error U1077: 'cl -c -nologo /FoBuild\Release\frozenmain /MD /Ox /D BUILD_FREEZE "-I./Include"  "-I./PC"      ".\Python\frozenmain.c"' : return code '0x2'
Stop.

I found the PC\pyconfig.h was removed since Python3.13. Should we update the document?

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 Tools/freeze/README 和 Tools/freeze/freeze.py 开始,然后使用 nmake 重现报告中的 Windows 命令。检查输出目录和 Windows 包含路径的处理方式,包括报告中指出的缺失 PC/pyconfig.h。完成的标准是,Windows 冻结说明或实现能够生成一个不包含报告中所述路径和头文件错误的构建。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
build-system, documentation, operating-systems
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。