Skip to content

xmlsec installation is getting failed on windows. #263

Description

@fahedm

Hi,

I'm on Windows Machine with Python 3.11
I don't want to downgrad python as other packages are dependent on it.
I'm trying to install python3-saml, it has dependency of xmlsec. This package is giving me issues while installation.

Building wheels for collected packages: xmlsec
Building wheel for xmlsec (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for xmlsec (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [22 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\xmlsec
copying src\xmlsec\py.typed -> build\lib.win-amd64-cpython-311\xmlsec
copying src\xmlsec\constants.pyi -> build\lib.win-amd64-cpython-311\xmlsec
copying src\xmlsec\template.pyi -> build\lib.win-amd64-cpython-311\xmlsec
copying src\xmlsec\tree.pyi -> build\lib.win-amd64-cpython-311\xmlsec
copying src\xmlsec_init_.pyi -> build\lib.win-amd64-cpython-311\xmlsec
running build_ext
starting static build on win32
Lib sources in: C:\Users\css148300\Desktop\OfficeProjects\DevHub\gsso-devhub-be\python-xmlsec\libs
Retrieving "https://github.com/bgaifullin/libxml2-win-binaries/releases/download/v2018.08/libxml2-2.9.4.win64.zip" to "libs\libxml2-2.9.4.win64.zip"
Retrieving "https://github.com/bgaifullin/libxml2-win-binaries/releases/download/v2018.08/libxslt-1.1.29.win64.zip" to "libs\libxslt-1.1.29.win64.zip"
Retrieving "https://github.com/bgaifullin/libxml2-win-binaries/releases/download/v2018.08/zlib-1.2.8.win64.zip" to "libs\zlib-1.2.8.win64.zip"
Retrieving "https://github.com/bgaifullin/libxml2-win-binaries/releases/download/v2018.08/iconv-1.14.win64.zip" to "libs\iconv-1.14.win64.zip"
Retrieving "https://github.com/bgaifullin/libxml2-win-binaries/releases/download/v2018.08/openssl-1.0.1.win64.zip" to "libs\openssl-1.0.1.win64.zip"
Retrieving "https://github.com/bgaifullin/libxml2-win-binaries/releases/download/v2018.08/xmlsec-1.2.24.win64.zip" to "libs\xmlsec-1.2.24.win64.zip"
building 'xmlsec' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for xmlsec
Failed to build xmlsec
ERROR: Could not build wheels for xmlsec, which is required to install pyproject.toml-based projects

I have build tools installed. I read numerous articles and tried every workaround but still no solution to this.
I have tried in WSL as well, but same kind of issue.
I have tried on Mac, there it was giving issue, but with help of #254 (comment) , I was able to resolve the issue on Mac.

do we have any solution/workaround for windows system?

Activity

  1. APouzi commented on Sep 19, 2023

    @APouzi

    I am stuck around this area too. I do believe that the windows C++ stuff is a red herring.
    My error is around building wheels, I remember I had another project in my work place that I had to figure out how to get this working within docker and my solution at the time was literally to just get Python to an older version. Not really a solution, but at the same time we had to get this working. I also had to get some other packages installed myself to see if this worked.
    Hoping someone has a solution to this

    `.....
    error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe' failed with exit code 1
    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for xmlsec
    Failed to build xmlsec
    ERROR: Could not build wheels for xmlsec, which is required to install pyproject.toml-based projects
    `

  2. fahedm commented on Sep 19, 2023

    @fahedm
    Author

    For Windows. there is a work around with WSL

    I installed Ubuntu 22.04 on WSL and tried installing xmlsec there. But again same kind of issue.

    Installed brew in Ubuntu, and followed the same workaround as written in #254 (comment)

    Now, I could install xmlsec.

    Hopefully, in new version these issues with different platforms will be taken care.

    Detailed Medium Article for this issue on windows

  3. bain2236 commented on Oct 17, 2023

    @bain2236

    I'm currently trying to ugprade from python 3.10 to 3.11 and this is blocking me, is there any update since this was opened?

  4. hegeteus commented on Jan 23, 2024

    @hegeteus

    @tkbaca I can't get your solution to work.

    C:...\libxml2-win-binaries\libiconv\MSVC14\libiconv.sln.metaproj : error MSB4126: The speci
    fied solution configuration "Release|x86" is invalid. Please specify a valid solution configuration using the Configura
    tion and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave thos
    e properties blank to use the default solution configuration. [C:...\libxml2-win-binaries\l
    ibiconv\MSVC14\libiconv.sln]

  5. hegeteus commented on Jan 24, 2024

    @hegeteus

    @tkbaca Thanks for the quick reply and help with the issue.

    That didn't work for me so I bruteforced the build.ps1 to only accept X64 and now it works...

    $x64Dir = "\x64"
    $distname = If($x64) { "win64" } Else { "win32" }
    If($vs2008) { $distname = "vs2008.$distname" }
    $vcvarsarch = "amd64"
    $vsver = If($vs2008) { "90" } Else { "2022" }

    This isn't a familiar environment for me (obviously), so maybe I screwed up while installing or configuring something with VS or the PowerShell. Gonna try building the wheel tomorrow though, but at least the zip files now seem to be in place as described in dist folder!

  6. mymy47 commented on Feb 7, 2024

    @mymy47
  7. mxamin commented on Apr 18, 2024

    @mxamin
    Collaborator

    Can you try it with the new release 1.3.14? We also provided wheels for windows OS.

  8. tomtom94 commented on May 24, 2024

    @tomtom94

    I am getting the error me too

    PS C:\Users\u1180188\Code\mvp-launch-tracker\back> pip install kerberos==1.3.1
    Collecting kerberos==1.3.1
      Downloading kerberos-1.3.1.tar.gz (19 kB)
      Preparing metadata (setup.py) ... done
    Building wheels for collected packages: kerberos
      Building wheel for kerberos (setup.py) ... error
      error: subprocess-exited-with-error
    
      × python setup.py bdist_wheel did not run successfully.
      │ exit code: 1
      ╰─> [74 lines of output]
          running bdist_wheel
          running build
          running build_ext
          building 'kerberos' extension
          creating build
          creating build\temp.win-amd64-cpython-311
          creating build\temp.win-amd64-cpython-311\Release
          creating build\temp.win-amd64-cpython-311\Release\src
          "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\u1180188\AppData\Local\Programs\Python\Python311\include -IC:\Users\u1180188\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\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" /Tcsrc/base64.c /Fobuild\temp.win-amd64-cpython-311\Release\src/base64.obj 'krb5-config' is not recognized as an internal or external command, operable program or batch file.
          cl : Command line warning D9024 : unrecognized source file type ''krb5-config'', object file assumed
          cl : Command line warning D9027 : source file ''krb5-config'' ignored
          cl : Command line warning D9024 : unrecognized source file type 'is', object file assumed
          cl : Command line warning D9027 : source file 'is' ignored
          cl : Command line warning D9024 : unrecognized source file type 'not', object file assumed
          cl : Command line warning D9027 : source file 'not' ignored
          cl : Command line warning D9024 : unrecognized source file type 'recognized', object file assumed
          cl : Command line warning D9027 : source file 'recognized' ignored
          cl : Command line warning D9024 : unrecognized source file type 'as', object file assumed
          cl : Command line warning D9027 : source file 'as' ignored
          cl : Command line warning D9024 : unrecognized source file type 'an', object file assumed
          cl : Command line warning D9027 : source file 'an' ignored
          cl : Command line warning D9024 : unrecognized source file type 'internal', object file assumed
          cl : Command line warning D9027 : source file 'internal' ignored
          cl : Command line warning D9024 : unrecognized source file type 'or', object file assumed
          cl : Command line warning D9027 : source file 'or' ignored
          cl : Command line warning D9024 : unrecognized source file type 'external', object file assumed
          cl : Command line warning D9027 : source file 'external' ignored
          cl : Command line warning D9024 : unrecognized source file type 'command,', object file assumed
          cl : Command line warning D9027 : source file 'command,' ignored
          cl : Command line warning D9024 : unrecognized source file type 'operable', object file assumed
          cl : Command line warning D9027 : source file 'operable' ignored
          cl : Command line warning D9024 : unrecognized source file type 'program', object file assumed
          cl : Command line warning D9027 : source file 'program' ignored
          cl : Command line warning D9024 : unrecognized source file type 'or', object file assumed
          cl : Command line warning D9027 : source file 'or' ignored
          cl : Command line warning D9024 : unrecognized source file type 'batch', object file assumed
          cl : Command line warning D9027 : source file 'batch' ignored
          cl : Command line warning D9024 : unrecognized source file type 'file.', object file assumed
          cl : Command line warning D9027 : source file 'file.' ignored
          base64.c
          "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\u1180188\AppData\Local\Programs\Python\Python311\include -IC:\Users\u1180188\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\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" /Tcsrc/kerberos.c /Fobuild\temp.win-amd64-cpython-311\Release\src/kerberos.obj 'krb5-config' is not recognized as an internal or external command, operable program or batch file.
          cl : Command line warning D9024 : unrecognized source file type ''krb5-config'', object file assumed
          cl : Command line warning D9027 : source file ''krb5-config'' ignored
          cl : Command line warning D9024 : unrecognized source file type 'is', object file assumed
          cl : Command line warning D9027 : source file 'is' ignored
          cl : Command line warning D9024 : unrecognized source file type 'not', object file assumed
          cl : Command line warning D9027 : source file 'not' ignored
          cl : Command line warning D9024 : unrecognized source file type 'recognized', object file assumed
          cl : Command line warning D9027 : source file 'recognized' ignored
          cl : Command line warning D9024 : unrecognized source file type 'as', object file assumed
          cl : Command line warning D9027 : source file 'as' ignored
          cl : Command line warning D9024 : unrecognized source file type 'an', object file assumed
          cl : Command line warning D9027 : source file 'an' ignored
          cl : Command line warning D9024 : unrecognized source file type 'internal', object file assumed
          cl : Command line warning D9027 : source file 'internal' ignored
          cl : Command line warning D9024 : unrecognized source file type 'or', object file assumed
          cl : Command line warning D9027 : source file 'or' ignored
          cl : Command line warning D9024 : unrecognized source file type 'external', object file assumed
          cl : Command line warning D9027 : source file 'external' ignored
          cl : Command line warning D9024 : unrecognized source file type 'command,', object file assumed
          cl : Command line warning D9027 : source file 'command,' ignored
          cl : Command line warning D9024 : unrecognized source file type 'operable', object file assumed
          cl : Command line warning D9027 : source file 'operable' ignored
          cl : Command line warning D9024 : unrecognized source file type 'program', object file assumed
          cl : Command line warning D9027 : source file 'program' ignored
          cl : Command line warning D9024 : unrecognized source file type 'or', object file assumed
          cl : Command line warning D9027 : source file 'or' ignored
          cl : Command line warning D9024 : unrecognized source file type 'batch', object file assumed
          cl : Command line warning D9027 : source file 'batch' ignored
          cl : Command line warning D9024 : unrecognized source file type 'file.', object file assumed
          cl : Command line warning D9027 : source file 'file.' ignored
          kerberos.c
          C:\Users\u1180188\AppData\Local\Temp\pip-install-bntlbqno\kerberos_22ad382f28bd451ebc0272cfa210dd0a\src\kerberosbasic.h(17): fatal error C1083: Cannot open include file: 'gssapi/gssapi.h': No such file or directory
          error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.40.33807\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
          [end of output]
    
      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for kerberos
      Running setup.py clean for kerberos
    Failed to build kerberos
    ERROR: Could not build wheels for kerberos, which is required to install pyproject.toml-based projects
    PS C:\Users\u1180188\Code\mvp-launch-tracker\back> python --version
    Python 3.11.9
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions