I tried to install cx_freeze on win11 and python 3.11.0 but got this error :
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\link.exe' failed with exit code 1181
I search on stack overflow but no solution with cx_freeze or that "link.exe"
I've installed VS Build Tools with these components : VS Build Tools modules
My PATH : The Path variable list
The complete log :
console.c
C:\Users\PC\AppData\Local\Temp\pip-install-kzzp9ljy\cx-freeze_b4000833d7e0415e9d2c0c894133bc4a\source\bases\common.c(170): warning C4996: 'Py_SetProgramName': deprecated in 3.11
C:\Users\PC\AppData\Local\Temp\pip-install-kzzp9ljy\cx-freeze_b4000833d7e0415e9d2c0c894133bc4a\source\bases\common.c(171): warning C4996: 'Py_SetPath': deprecated in 3.11
C:\Users\PC\AppData\Local\Temp\pip-install-kzzp9ljy\cx-freeze_b4000833d7e0415e9d2c0c894133bc4a\source\bases\common.c(173): warning C4996: 'PySys_SetArgvEx': deprecated in 3.11
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /MANIFEST:EMBED,ID=1 "/LIBPATH:C:\Program Files\Python311\libs" "/LIBPATH:C:\Program Files\Python311" "/LIBPATH:C:\Program Files\Python311\PCbuild\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64" build\temp.win-amd64-cpython-311\Release\source/bases/console.obj /OUT:build\lib.win-amd64-cpython-311\cx_Freeze\bases\console-cp311-win_amd64.exe /MANIFEST
G‚n‚ration de code en cours
Fin de la g‚n‚ration du code
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD "-IC:\Program Files\Python311\include" "-IC:\Program Files\Python311\Include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsource/bases/Win32GUI.c /Fobuild\temp.win-amd64-cpython-311\Release\source/bases/Win32GUI.obj
Win32GUI.c
C:\Users\PC\AppData\Local\Temp\pip-install-kzzp9ljy\cx-freeze_b4000833d7e0415e9d2c0c894133bc4a\source\bases\common.c(170): warning C4996: 'Py_SetProgramName': deprecated in 3.11
C:\Users\PC\AppData\Local\Temp\pip-install-kzzp9ljy\cx-freeze_b4000833d7e0415e9d2c0c894133bc4a\source\bases\common.c(171): warning C4996: 'Py_SetPath': deprecated in 3.11
C:\Users\PC\AppData\Local\Temp\pip-install-kzzp9ljy\cx-freeze_b4000833d7e0415e9d2c0c894133bc4a\source\bases\common.c(173): warning C4996: 'PySys_SetArgvEx': deprecated in 3.11
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /MANIFEST:EMBED,ID=1 "/LIBPATH:C:\Program Files\Python311\libs" "/LIBPATH:C:\Program Files\Python311" "/LIBPATH:C:\Program Files\Python311\PCbuild\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64" user32.lib build\temp.win-amd64-cpython-311\Release\source/bases/Win32GUI.obj /OUT:build\lib.win-amd64-cpython-311\cx_Freeze\bases\Win32GUI-cp311-win_amd64.exe /MANIFEST
G‚n‚ration de code en cours
Fin de la g‚n‚ration du code
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Isource/bases "-IC:\Program Files\Python311\include" "-IC:\Program Files\Python311\Include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsource/bases/Win32Service.c /Fobuild\temp.win-amd64-cpython-311\Release\source/bases/Win32Service.obj
Win32Service.c
C:\Users\PC\AppData\Local\Temp\pip-install-kzzp9ljy\cx-freeze_b4000833d7e0415e9d2c0c894133bc4a\source\bases\common.c(170): warning C4996: 'Py_SetProgramName': deprecated in 3.11
C:\Users\PC\AppData\Local\Temp\pip-install-kzzp9ljy\cx-freeze_b4000833d7e0415e9d2c0c894133bc4a\source\bases\common.c(171): warning C4996: 'Py_SetPath': deprecated in 3.11
C:\Users\PC\AppData\Local\Temp\pip-install-kzzp9ljy\cx-freeze_b4000833d7e0415e9d2c0c894133bc4a\source\bases\common.c(173): warning C4996: 'PySys_SetArgvEx': deprecated in 3.11
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /MANIFEST:EMBED,ID=1 "/LIBPATH:C:\Program Files\Python311\libs" "/LIBPATH:C:\Program Files\Python311" "/LIBPATH:C:\Program Files\Python311\PCbuild\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64" advapi32.lib cx_Logging.lib delayimp.lib build\temp.win-amd64-cpython-311\Release\source/bases/Win32Service.obj /OUT:build\lib.win-amd64-cpython-311\cx_Freeze\bases\Win32Service-cp311-win_amd64.exe /DELAYLOAD:cx_Logging.cp311-win_amd64.pyd /MANIFEST
LINK : fatal error LNK1181: impossible d'ouvrir le fichier en entr‚e 'cx_Logging.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\link.exe' failed with exit code 1181
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cx_freeze
Failed to build cx_freeze
ERROR: Could not build wheels for cx_freeze, which is required to install pyproject.toml-based projects
I tried Auto Fixing build tools, reinstalling pip, add sdk to path and I installed all the modules even if they are useless.
I don't have much experience with python
but had to run some setup for rebuilding a tool we wrote in python and encountered the same issue.
This setup was also relying on cx_Freeze
. I think there is a bug possibly in newer version of MSVC
or cx_Freeze
itself - no idea.
I worked around by installing this package individually directly from the source, running:
pip install --upgrade git+https://github.com/anthony-tuininga/cx_Freeze.git@main
I re-run the setup afterwards and it worked. The downside is that in the future I would need to manually upgrade this package rather than relying on it being restored auto-magically during rebuilding but at least it's fixed now for me.
Good luck, hope it works for you too.
Edit: This is a known issue, there is an open bug you can subscribe to follow progress updates: https://github.com/marcelotduarte/cx_Freeze/issues/1662