python / python/cpython

`freeze.py` doesn't work on Windows

オープン
#132,225 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

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. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Tools/freeze/README と Tools/freeze/freeze.py から始め、次にレポートにある Windows コマンドを nmake で再現します。出力ディレクトリと Windows のインクルードパスがどのように処理されているかを確認し、レポートで指摘されている PC/pyconfig.h の欠落も確認します。Windows の freeze 手順または実装によって、レポートにあるパスおよびヘッダーのエラーなしでビルドが生成されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
build-system, documentation, operating-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。