skip to Main Content

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:UsersPCAppDataLocalTemppip-install-kzzp9ljycx-freeze_b4000833d7e0415e9d2c0c894133bc4asourcebasescommon.c(170): warning C4996: 'Py_SetProgramName': deprecated in 3.11  
      C:UsersPCAppDataLocalTemppip-install-kzzp9ljycx-freeze_b4000833d7e0415e9d2c0c894133bc4asourcebasescommon.c(171): warning C4996: 'Py_SetPath': deprecated in 3.11
      C:UsersPCAppDataLocalTemppip-install-kzzp9ljycx-freeze_b4000833d7e0415e9d2c0c894133bc4asourcebasescommon.c(173): warning C4996: 'PySys_SetArgvEx': deprecated in 3.11    
      "C:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.34.31933binHostX86x64link.exe" /nologo /INCREMENTAL:NO /LTCG /MANIFEST:EMBED,ID=1 "/LIBPATH:C:Program FilesPython311libs" "/LIBPATH:C:Program FilesPython311" "/LIBPATH:C:Program FilesPython311PCbuildamd64" "/LIBPATH:C:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.34.31933ATLMFClibx64" "/LIBPATH:C:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.34.31933libx64" "/LIBPATH:C:Program Files (x86)Windows KitsNETFXSDK4.8libumx64" "/LIBPATH:C:Program Files (x86)Windows Kits10lib10.0.22621.0ucrtx64" "/LIBPATH:C:Program Files (x86)Windows Kits10\lib10.0.22621.0\umx64" buildtemp.win-amd64-cpython-311Releasesource/bases/console.obj /OUT:buildlib.win-amd64-cpython-311cx_Freezebasesconsole-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 Studio2022BuildToolsVCToolsMSVC14.34.31933binHostX86x64cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD "-IC:Program FilesPython311include" "-IC:Program FilesPython311Include" "-IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.34.31933include" "-IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.34.31933ATLMFCinclude" "-IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCAuxiliaryVSinclude" "-IC:Program Files (x86)Windows Kits10include10.0.22621.0ucrt" "-IC:Program Files (x86)Windows Kits10\include10.0.22621.0\um" "-IC:Program Files (x86)Windows Kits10\include10.0.22621.0\shared" "-IC:Program Files (x86)Windows Kits10\include10.0.22621.0\winrt" "-IC:Program Files (x86)Windows Kits10\include10.0.22621.0\cppwinrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.8includeum" /Tcsource/bases/Win32GUI.c /Fobuildtemp.win-amd64-cpython-311Releasesource/bases/Win32GUI.obj
      Win32GUI.c
      C:UsersPCAppDataLocalTemppip-install-kzzp9ljycx-freeze_b4000833d7e0415e9d2c0c894133bc4asourcebasescommon.c(170): warning C4996: 'Py_SetProgramName': deprecated in 3.11  
      C:UsersPCAppDataLocalTemppip-install-kzzp9ljycx-freeze_b4000833d7e0415e9d2c0c894133bc4asourcebasescommon.c(171): warning C4996: 'Py_SetPath': deprecated in 3.11
      C:UsersPCAppDataLocalTemppip-install-kzzp9ljycx-freeze_b4000833d7e0415e9d2c0c894133bc4asourcebasescommon.c(173): warning C4996: 'PySys_SetArgvEx': deprecated in 3.11    
      "C:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.34.31933binHostX86x64link.exe" /nologo /INCREMENTAL:NO /LTCG /MANIFEST:EMBED,ID=1 "/LIBPATH:C:Program FilesPython311libs" "/LIBPATH:C:Program FilesPython311" "/LIBPATH:C:Program FilesPython311PCbuildamd64" "/LIBPATH:C:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.34.31933ATLMFClibx64" "/LIBPATH:C:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.34.31933libx64" "/LIBPATH:C:Program Files (x86)Windows KitsNETFXSDK4.8libumx64" "/LIBPATH:C:Program Files (x86)Windows Kits10lib10.0.22621.0ucrtx64" "/LIBPATH:C:Program Files (x86)Windows Kits10\lib10.0.22621.0\umx64" user32.lib buildtemp.win-amd64-cpython-311Releasesource/bases/Win32GUI.obj /OUT:buildlib.win-amd64-cpython-311cx_FreezebasesWin32GUI-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 Studio2022BuildToolsVCToolsMSVC14.34.31933binHostX86x64cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Isource/bases "-IC:Program FilesPython311include" "-IC:Program FilesPython311Include" "-IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.34.31933include" "-IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.34.31933ATLMFCinclude" "-IC:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCAuxiliaryVSinclude" "-IC:Program Files (x86)Windows Kits10include10.0.22621.0ucrt" "-IC:Program Files (x86)Windows Kits10\include10.0.22621.0\um" "-IC:Program Files (x86)Windows Kits10\include10.0.22621.0\shared" "-IC:Program Files (x86)Windows Kits10\include10.0.22621.0\winrt" "-IC:Program Files (x86)Windows Kits10\include10.0.22621.0\cppwinrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.8includeum" /Tcsource/bases/Win32Service.c /Fobuildtemp.win-amd64-cpython-311Releasesource/bases/Win32Service.obj
      Win32Service.c
      C:UsersPCAppDataLocalTemppip-install-kzzp9ljycx-freeze_b4000833d7e0415e9d2c0c894133bc4asourcebasescommon.c(170): warning C4996: 'Py_SetProgramName': deprecated in 3.11  
      C:UsersPCAppDataLocalTemppip-install-kzzp9ljycx-freeze_b4000833d7e0415e9d2c0c894133bc4asourcebasescommon.c(171): warning C4996: 'Py_SetPath': deprecated in 3.11
      C:UsersPCAppDataLocalTemppip-install-kzzp9ljycx-freeze_b4000833d7e0415e9d2c0c894133bc4asourcebasescommon.c(173): warning C4996: 'PySys_SetArgvEx': deprecated in 3.11    
      "C:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.34.31933binHostX86x64link.exe" /nologo /INCREMENTAL:NO /LTCG /MANIFEST:EMBED,ID=1 "/LIBPATH:C:Program FilesPython311libs" "/LIBPATH:C:Program FilesPython311" "/LIBPATH:C:Program FilesPython311PCbuildamd64" "/LIBPATH:C:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.34.31933ATLMFClibx64" "/LIBPATH:C:Program Files (x86)Microsoft Visual Studio2022BuildToolsVCToolsMSVC14.34.31933libx64" "/LIBPATH:C:Program Files (x86)Windows KitsNETFXSDK4.8libumx64" "/LIBPATH:C:Program Files (x86)Windows Kits10lib10.0.22621.0ucrtx64" "/LIBPATH:C:Program Files (x86)Windows Kits10\lib10.0.22621.0\umx64" advapi32.lib cx_Logging.lib delayimp.lib buildtemp.win-amd64-cpython-311Releasesource/bases/Win32Service.obj /OUT:buildlib.win-amd64-cpython-311cx_FreezebasesWin32Service-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.

2

Answers


  1. 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

    Login or Signup to reply.
  2. To install the latest development build [1] compatible with Python 3.11:

    pip install --upgrade --pre --extra-index-url https://marcelotduarte.github.io/packages/ cx_Freeze

    [1] https://github.com/marcelotduarte/cx_Freeze#installation

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search