ShockKhay
ShockKhay

Reputation: 75

Python Qpid Proton dependency build error on Windows

I have a project requiring me to build Python backend locally so I can work on frontend (Angular).

Python project has a dependency, python-qpid-proton v0.33.0, which fails to build.

I'm using the command: pip install -e . to install the dependencies.

I've reinstalled Visual Studio 2022 with full C++ development support required to run it, but the dependency build fails anyway, with the following error:

Running setup.py install for python-qpid-proton ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\tools\python38\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\(<user>)\\AppData\\Local\\Temp\\pip-install-hq8uvwkp\\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\\setup.py'"'"'; __file__='"'"'C:\\Users\\(<user>)\\AppData\\Local\\Temp\\pip-install-hq8uvwkp\\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\(<user>)\AppData\Local\Temp\pip-record-s8y66xc7\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\tools\python38\Include\python-qpid-proton'
         cwd: C:\Users\(<user>)\AppData\Local\Temp\pip-install-hq8uvwkp\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\
    Complete output (30 lines):
    running install
    running build
    running build_py
    running build_ext
    running configure
    Warning: command not found: pkg-config
    Building the bundled proton-c sources into the extension
    Warning: command not found: pkg-config
    Warning: Windows - only the ANONYMOUS and PLAIN mechanisms will be supported!
    creating build
    creating build\temp.win-amd64-3.8
    creating build\temp.win-amd64-3.8\Release
    creating build\temp.win-amd64-3.8\Release\Users
    creating build\temp.win-amd64-3.8\Release\Users\(<user>)
    creating build\temp.win-amd64-3.8\Release\Users\(<user>)\AppData
    creating build\temp.win-amd64-3.8\Release\Users\(<user>)\AppData\Local
    creating build\temp.win-amd64-3.8\Release\Users\(<user>)\AppData\Local\Temp
    creating build\temp.win-amd64-3.8\Release\Users\(<user>)\AppData\Local\Temp\pip-install-hq8uvwkp
    creating build\temp.win-amd64-3.8\Release\Users\(<user>)\AppData\Local\Temp\pip-install-hq8uvwkp\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae
    creating build\temp.win-amd64-3.8\Release\Users\(<user>)\AppData\Local\Temp\pip-install-hq8uvwkp\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\src
    creating build\temp.win-amd64-3.8\Release\Users\(<user>)\AppData\Local\Temp\pip-install-hq8uvwkp\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\src\core
    creating build\temp.win-amd64-3.8\Release\Users\(<user>)\AppData\Local\Temp\pip-install-hq8uvwkp\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\src\core\object
    creating build\temp.win-amd64-3.8\Release\Users\(<user>)\AppData\Local\Temp\pip-install-hq8uvwkp\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\src\compiler
    creating build\temp.win-amd64-3.8\Release\Users\(<user>)\AppData\Local\Temp\pip-install-hq8uvwkp\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\src\compiler\msvc
    creating build\temp.win-amd64-3.8\Release\Users\(<user>)\AppData\Local\Temp\pip-install-hq8uvwkp\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\src\ssl
    creating build\temp.win-amd64-3.8\Release\Users\(<user>)\AppData\Local\Temp\pip-install-hq8uvwkp\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\src\sasl
    C:\Tools\VS2022\VC\Tools\MSVC\14.31.31103\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPROTON_DECLARE_STATIC -Ibuild\include -IC:\Users\(<user>)\AppData\Local\Temp\pip-install-hq8uvwkp\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\include -IC:\Users\(<user>)\AppData\Local\Temp\pip-install-hq8uvwkp\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\src -IC:\Tools\VS2022\VC\Tools\MSVC\14.31.31103\ATLMFC\include -IC:\Tools\VS2022\VC\Tools\MSVC\14.31.31103\include "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /TcC:\Users\(<user>)\AppData\Local\Temp\pip-install-hq8uvwkp\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\src\core\autodetect.c /Fobuild\temp.win-amd64-3.8\Release\Users\(<user>)\AppData\Local\Temp\pip-install-hq8uvwkp\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\src\core\autodetect.obj
    autodetect.c
    C:\Users\(<user>)\AppData\Local\Temp\pip-install-hq8uvwkp\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\src\core\autodetect.c : fatal error C1083: Cannot open compiler generated file: '': Invalid argument
    error: command 'C:\\Tools\\VS2022\\VC\\Tools\\MSVC\\14.31.31103\\bin\\HostX86\\x64\\cl.exe' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\tools\python38\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\(<user>)\\AppData\\Local\\Temp\\pip-install-hq8uvwkp\\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\\setup.py'"'"'; __file__='"'"'C:\\Users\\(<user>)\\AppData\\Local\\Temp\\pip-install-hq8uvwkp\\python-qpid-proton_c773d42867ac46ec992c107f4e3294ae\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\(<user>)\AppData\Local\Temp\pip-record-s8y66xc7\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\tools\python38\Include\python-qpid-proton' Check the logs for full command output.

However, cloning the qpid-proton repository from GitHub and following instructions to install using Python, CMake, Swig and Visual Studio works fine and the projects builds binaries without a problem, and deploys them in C:\Program Files (x86)\Proton...

I've tried running as my user (who is Admin), and running in Powershell as Administrator, same error appears. Same erros appear in Git Bash, CMD, Powershell, both as user and as Administrator.

Any idea why the build fails?

Upvotes: 1

Views: 704

Answers (1)

David Valpey
David Valpey

Reputation: 21

The error c1083 is pretty generic and just means that the compiler could not find the file it was looking for. In your case, the file name is empty. The file name is empty because it exceeded the limit of what is allowed by the compiler (probably around 255 characters).

See here for more discussion: https://githubhot.com/repo/MicrosoftDocs/cpp-docs/issues/3336

In our case, we resolved the issue by changing the temporary directory where pip builds the files. Since this was Windows, we used set TMPDIR=c:\tmp and then ran pip install python-qpid-proton. The files then compiled correctly and the package was installed.

Hope this helps...

Upvotes: 2

Related Questions