1

I am working on creating a Python project which includes the BeautifulSoup module. As part of this, I require the ability to parse XML, and as a dependency on that, I require that the lxml module is installed.

I am attempting to build a PEX file with Pants, and I am seeing that I am unable to resolve the package for lxml, which is required for BeautifulSoup to parse XML.

I am seeing the following error:

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.

Can I manipulate something in my pants.ini file to pull in this particular library?

Huckphin
  • 410
  • 4
  • 17

1 Answers1

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

John Sirois
  • 351
  • 1
  • 4
  • Yes, I am building a multiplatform PEX. We currently have a repo that we can pull in wheels into for different platforms. Do you think that it would make sense for me to put the wheel I need for the other platform in here? Would that work if I did that? – Huckphin May 19 '16 at 01:25
  • Yes, that should do it! – John Sirois May 19 '16 at 01:26
  • You can see an answer I gave on multiplatform pex building here: http://stackoverflow.com/questions/34979100/pants-includes-os-x-specific-python-wheels – ericzundel May 19 '16 at 13:35