gpt4 book ai didi

python - 将 lxml 库添加到项目

转载 作者:太空宇宙 更新时间:2023-11-04 09:30:04 24 4
gpt4 key购买 nike

我正在用 Python 编写一个将 XML 文件解析为 JSON 的小项目。它使用了一个lxml库(需要使用可以恢复XML文件的XMLParser)。

问题是我需要以开箱即用的方式交付我的项目。 lxml 不是标准的 Python 库,所以我需要将它包含在我的脚本中。该脚本应该可以从 Linux Debian 9 或 Windows Server 上运行。

是否可以使用我的脚本交付工作库?lxml 需要编译才能工作,它取决于系统,它还需要 libxml2 和 libxslt 库才能在 Windows 上工作。

谢谢,西蒙

最佳答案

检查 PyInstaller https://pyinstaller.readthedocs.io/en/stable/

PyInstaller bundles a Python application and all its dependencies into a single package. The user can run the packaged app without installing a Python interpreter or any modules.

关于python - 将 lxml 库添加到项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56094072/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com