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 include 路徑的處理方式,包括報告中指出的缺少 PC/pyconfig.h。完成的標準是,Windows freeze 指示或實作能夠產生一個不含報告中所述路徑和標頭錯誤的建置。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
build-system, documentation, operating-systems
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。