【发布时间】:2022-02-03 17:55:53
【问题描述】:
xmlsec docs 建议 pip install xmlsec 应该开箱即用
从 1.3.7 开始,预构建的轮子可用于 Windows,因此运行 pip install xmlsec 就足够了。
但是,这引发了错误(见下文)。
我找到了this question,我认为答案表明我需要预先安装本机库。但由于我在 Windows 上并且有点初学者,我不知道如何安装 libxml2-dev、libxmlsec1-dev 或 libxmlsec1-openssl 等软件包。 pip install libxml2-dev 不起作用,我无法在 Windows 上安装 brew。我已经广泛搜索了 SO 和 Google,但无法弄清楚。
我还尝试通过从 bin 文件夹中提取一些文件并将其添加到 PATH 中来单独安装 libxml2,如下所述:https://pages.lip6.fr/Jean-Francois.Perrot/XML-Int/Session1/WinLibxml.html,但这也不起作用。
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
╰─> [62 lines of output]
running bdist_wheel
running build
running build_py
package init file 'src\xmlsec\__init__.py' not found (or not a regular file)
running build_ext
building 'xmlsec' extension
constants.c
...LOTS OF ERRORS/WARNINGS...
fatal error C1047: The object or library file 'C:\Users\12345\AppData\Local\Temp\pip-install-3tfgg6bc\xmlsec_12345\build\tmp\libs\iconv-1.14.win64\lib\iconv_a.lib' was created with an older compiler than other objects; rebuild old objects and libraries
LINK : fatal error LNK1257: code generation failed
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\link.exe' failed with exit code 1257
[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`
【问题讨论】:
标签: python windows pip command-line-interface