can't build lxml 3.0 with Python 3.3 on Mac OS X

Bug #1065139 reported by Colin McPhail on 2012-10-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Building lxml 3.0 using Python 3.3 (probably any Python 3 will fail) on Mac OS X 10.8 fails:

$ STATIC_DEPS=true pip install lxml==3.0
Downloading/unpacking lxml==3.0
  Running egg_info for package lxml
    Building lxml version 3.0.
    Latest version of libiconv is 1.14
    Using existing libiconv downloaded into libs/libiconv-1.14.tar.gz (delete this file if you want to re-download the package)
    Unpacking libiconv-1.14.tar.gz into build/tmp
    Latest version of libxml2 is 2.9.0
    Using existing libxml2 downloaded into libs/libxml2-2.9.0.tar.gz (delete this file if you want to re-download the package)
    Unpacking libxml2-2.9.0.tar.gz into build/tmp
    Latest version of libxslt is 1.1.27
    Using existing libxslt downloaded into libs/libxslt-1.1.27.tar.gz (delete this file if you want to re-download the package)
    Unpacking libxslt-1.1.27.tar.gz into build/tmp
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/var/folders/cl/7k35th017tn0v9t9rphhcskh0000gn/T/pip-build/lxml/", line 226, in <module>
      File "/var/folders/cl/7k35th017tn0v9t9rphhcskh0000gn/T/pip-build/lxml/", line 139, in setup_extra_options
      File "./", line 57, in ext_modules
      File "./", line 298, in build_libxml2xslt
        if (xcode_version.startswith('Xcode') and
    TypeError: startswith first arg must be bytes or a tuple of bytes, not str

If I fix that problem and do a manual build I hit problem (2) described in bug#1056157.

scoder (scoder) wrote :

Could you send a pull request with your fix?

Colin McPhail (mcphail-colin) wrote :

Being a bit old-school I've not caught up with 'pull requests' yet. I've attached a patch file showing the two lines I added to

scoder (scoder) wrote :

Thanks! I think we can just always decode it, even in Py2. I've pushed a fix.

Regarding pull requests, you can actually edit the file online on github (but you need an account for that).

Changed in lxml:
assignee: nobody → Stefan Behnel (scoder)
importance: Undecided → Medium
status: New → Fix Committed
scoder (scoder) wrote :

Could you comment in ticket 1056157 ? Sadly, it describes two problems, so I can't tell which one you are referring two. The first one *should* be solved and the other one is trivial to work around.

Colin McPhail (mcphail-colin) wrote :

It was the problem in the libxml2-2.9.0 source that I was referring to. I worked around that but the build of libxml2-2.9.0 is still failing. Here is the end of the build log:

Making all in doc
Making all in .
make[3]: Nothing to be done for `all-am'.
Making all in devhelp
make[3]: *** No rule to make target `home.png', needed by `all-am'. Stop.
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Traceback (most recent call last):
  File "", line 226, in <module>
  File "", line 139, in setup_extra_options
  File "/Users/colin/Python/lxml-3.0/", line 57, in ext_modules
  File "/Users/colin/Python/lxml-3.0/", line 340, in build_libxml2xslt
    cmmi(libxml2_configure_cmd, libxml2_dir, multicore, **call_setup)
  File "/Users/colin/Python/lxml-3.0/", line 266, in cmmi
    cwd=build_dir, **call_setup)
  File "/Users/colin/Python/lxml-3.0/", line 249, in call_subprocess
    raise Exception('Command "%s" returned code %s' % (cmd_desc, returncode))
Exception: Command "make -j5" returned code 512

It looks like a file 'home.png' in the libxml2-2.9.0 documentation tree is missing.

This isn't lxml's problem so I am happy for this bug report to be marked fixed.

scoder (scoder) wrote :

Fix has been released in lxml 3.0.1.

Changed in lxml:
status: Fix Committed → Fix Released
scoder (scoder) on 2013-04-28
Changed in lxml:
milestone: none → 3.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers