pip install lxml出错

时间:2015-06-04 13:36:13

标签: python macos pip virtualenv lxml

我尝试使用pip install lxml在我的mac(yosemite)上安装lxml,并收到以下错误消息。我在virtualenv以及系统范围内尝试了相同的结果。我的virtualenv是Python3和系统范围我用pip和pip3尝试过。我不知道该怎么做错误。

(testenv3)testenv3 > pip install lxml
Collecting lxml
  Using cached lxml-3.4.4.tar.gz
Installing collected packages: lxml
  Running setup.py install for lxml
    Complete output from command /Users/mmarotta/.virtualenvs/testenv3/bin/python3.4 -c "import setuptools, tokenize;__file__='/private/var/folders/7m/hjg5_zf53nvfhpf9dn8ms7hh0000gn/T/pip-build-dyli2irl/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/7m/hjg5_zf53nvfhpf9dn8ms7hh0000gn/T/pip-r09rujlw-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mmarotta/.virtualenvs/testenv3/bin/../include/site/python3.4/lxml:
    Building lxml version 3.4.4.
    Building without Cython.
    Using build configuration of libxslt 1.1.28
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.10-x86_64-3.4
    creating build/lib.macosx-10.10-x86_64-3.4/lxml
    copying src/lxml/__init__.py -> build/lib.macosx-10.10-x86_64-3.4/lxml
    copying src/lxml/_elementpath.py -> build/lib.macosx-10.10-x86_64-3.4/lxml
    copying src/lxml/builder.py -> build/lib.macosx-10.10-x86_64-3.4/lxml
    copying src/lxml/cssselect.py -> build/lib.macosx-10.10-x86_64-3.4/lxml
    copying src/lxml/doctestcompare.py -> build/lib.macosx-10.10-x86_64-3.4/lxml
    copying src/lxml/ElementInclude.py -> build/lib.macosx-10.10-x86_64-3.4/lxml
    copying src/lxml/pyclasslookup.py -> build/lib.macosx-10.10-x86_64-3.4/lxml
    copying src/lxml/sax.py -> build/lib.macosx-10.10-x86_64-3.4/lxml
    copying src/lxml/usedoctest.py -> build/lib.macosx-10.10-x86_64-3.4/lxml
    creating build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/__init__.py -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    creating build/lib.macosx-10.10-x86_64-3.4/lxml/html
    copying src/lxml/html/__init__.py -> build/lib.macosx-10.10-x86_64-3.4/lxml/html
    copying src/lxml/html/_diffcommand.py -> build/lib.macosx-10.10-x86_64-3.4/lxml/html
    copying src/lxml/html/_html5builder.py -> build/lib.macosx-10.10-x86_64-3.4/lxml/html
    copying src/lxml/html/_setmixin.py -> build/lib.macosx-10.10-x86_64-3.4/lxml/html
    copying src/lxml/html/builder.py -> build/lib.macosx-10.10-x86_64-3.4/lxml/html
    copying src/lxml/html/clean.py -> build/lib.macosx-10.10-x86_64-3.4/lxml/html
    copying src/lxml/html/defs.py -> build/lib.macosx-10.10-x86_64-3.4/lxml/html
    copying src/lxml/html/diff.py -> build/lib.macosx-10.10-x86_64-3.4/lxml/html
    copying src/lxml/html/ElementSoup.py -> build/lib.macosx-10.10-x86_64-3.4/lxml/html
    copying src/lxml/html/formfill.py -> build/lib.macosx-10.10-x86_64-3.4/lxml/html
    copying src/lxml/html/html5parser.py -> build/lib.macosx-10.10-x86_64-3.4/lxml/html
    copying src/lxml/html/soupparser.py -> build/lib.macosx-10.10-x86_64-3.4/lxml/html
    copying src/lxml/html/usedoctest.py -> build/lib.macosx-10.10-x86_64-3.4/lxml/html
    creating build/lib.macosx-10.10-x86_64-3.4/lxml/isoschematron
    copying src/lxml/isoschematron/__init__.py -> build/lib.macosx-10.10-x86_64-3.4/lxml/isoschematron
    copying src/lxml/lxml.etree.h -> build/lib.macosx-10.10-x86_64-3.4/lxml
    copying src/lxml/lxml.etree_api.h -> build/lib.macosx-10.10-x86_64-3.4/lxml
    copying src/lxml/includes/c14n.pxd -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/config.pxd -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/dtdvalid.pxd -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/etreepublic.pxd -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/htmlparser.pxd -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/relaxng.pxd -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/schematron.pxd -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/tree.pxd -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/uri.pxd -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/xinclude.pxd -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/xmlerror.pxd -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/xmlparser.pxd -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/xmlschema.pxd -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/xpath.pxd -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/xslt.pxd -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/etree_defs.h -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    copying src/lxml/includes/lxml-version.h -> build/lib.macosx-10.10-x86_64-3.4/lxml/includes
    creating build/lib.macosx-10.10-x86_64-3.4/lxml/isoschematron/resources
    creating build/lib.macosx-10.10-x86_64-3.4/lxml/isoschematron/resources/rng
    copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.macosx-10.10-x86_64-3.4/lxml/isoschematron/resources/rng
    creating build/lib.macosx-10.10-x86_64-3.4/lxml/isoschematron/resources/xsl
    copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.macosx-10.10-x86_64-3.4/lxml/isoschematron/resources/xsl
    copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.macosx-10.10-x86_64-3.4/lxml/isoschematron/resources/xsl
    creating build/lib.macosx-10.10-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.macosx-10.10-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.macosx-10.10-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.macosx-10.10-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.macosx-10.10-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.macosx-10.10-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.macosx-10.10-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    running build_ext
    building 'lxml.etree' extension
    creating build/temp.macosx-10.10-x86_64-3.4
    creating build/temp.macosx-10.10-x86_64-3.4/src
    creating build/temp.macosx-10.10-x86_64-3.4/src/lxml
    clang -Wno-unused-result -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/opt/sqlite/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/include/libxml2 -I/private/var/folders/7m/hjg5_zf53nvfhpf9dn8ms7hh0000gn/T/pip-build-dyli2irl/lxml/src/lxml/includes -I/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/include/python3.4m -c src/lxml/lxml.etree.c -o build/temp.macosx-10.10-x86_64-3.4/src/lxml/lxml.etree.o -w -flat_namespace
    In file included from src/lxml/lxml.etree.c:239:
    /private/var/folders/7m/hjg5_zf53nvfhpf9dn8ms7hh0000gn/T/pip-build-dyli2irl/lxml/src/lxml/includes/etree_defs.h:14:10: fatal error: 'libxml/xmlversion.h' file not found
    #include "libxml/xmlversion.h"
             ^
    1 error generated.
    /usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    error: command 'clang' failed with exit status 1

    ----------------------------------------
Command "/Users/mmarotta/.virtualenvs/testenv3/bin/python3.4 -c "import setuptools, tokenize;__file__='/private/var/folders/7m/hjg5_zf53nvfhpf9dn8ms7hh0000gn/T/pip-build-dyli2irl/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/7m/hjg5_zf53nvfhpf9dn8ms7hh0000gn/T/pip-r09rujlw-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mmarotta/.virtualenvs/testenv3/bin/../include/site/python3.4/lxml" failed with error code 1 in /private/var/folders/7m/hjg5_zf53nvfhpf9dn8ms7hh0000gn/T/pip-build-dyli2irl/lxml

0 个答案:

没有答案