1

我正在创建一个包含 BeautifulSoup 模块的 Python 项目。作为其中的一部分,我需要解析 XML 的能力,并且作为对此的依赖,我需要安装 lxml 模块。

我正在尝试使用 Pants 构建一个 PEX 文件,但我发现我无法解析 lxml 的包,这是 BeautifulSoup 解析 XML 所必需的。

我看到以下错误:

Exception message: Could not get distribution for
SourcePackage(u'file:///Users/x/.pants.d/python-setup/resolved_requirements/CPython-2.7.10/lxml-3.5.0.tar.gz') on platform linux-x86_64.

我可以操纵pants.ini文件中的某些内容来拉入这个特定的库吗?

4

1 回答 1

1

The error says lxml couldn't be obtained for Linux. Are you building a multiplatform pex on OSX? If so that says no pre-built lxml for Linux can be found. We don't currently have focused docs on multiplatform pexes, but the docs here do discuss building one for Pants itself: http://www.pantsbuild.org/howto_develop.html

于 2016-05-19T01:13:22.517 回答