Skip to content

freeze.py doesn't work on Windows #132225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
littlebutt opened this issue Apr 7, 2025 · 2 comments
Open

freeze.py doesn't work on Windows #132225

littlebutt opened this issue Apr 7, 2025 · 2 comments
Labels
OS-windows type-bug An unexpected behavior, bug, or error

Comments

@littlebutt
Copy link
Contributor

littlebutt commented Apr 7, 2025

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

@littlebutt littlebutt added the type-bug An unexpected behavior, bug, or error label Apr 7, 2025
@picnixz
Copy link
Member

picnixz commented Apr 7, 2025

cc @zooba

@zooba
Copy link
Member

zooba commented Apr 7, 2025

Needs a maintainer, or more likely deprecation - there are better tools out there than this script already. I was surprised it even "supports" Windows, pretty sure the test is only run on Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants