简体   繁体   English

ImportError:在创建scrapy项目时,没有名为lxml.html的模块

[英]ImportError: No module named lxml.html when creating scrapy project

I'm on OS 10.9.5 and get the following error when I try to create a scrapy project: 我在OS 10.9.5上,尝试创建scrapy项目时出现以下错误:

Traceback (most recent call last):
  File "/usr/local/bin/scrapy", line 7, in <module>
    from scrapy.cmdline import execute
  File "/Library/Python/2.7/site-packages/scrapy/__init__.py", line 56, in <module>
    from scrapy.spider import Spider
  File "/Library/Python/2.7/site-packages/scrapy/spider.py", line 7, in <module>
    from scrapy.http import Request
  File "/Library/Python/2.7/site-packages/scrapy/http/__init__.py", line 11, in <module>
    from scrapy.http.request.form import FormRequest
  File "/Library/Python/2.7/site-packages/scrapy/http/request/form.py", line 9, in <module>
    import lxml.html
ImportError: No module named lxml.html

I first tried to uninstall and then reinstall scrapy using pip. 我首先尝试卸载,然后使用pip重新安装scrapy。 I'm not sure whether the problem is actually that something went wrong during the installation of scrapy. 我不确定问题实际上是否是在scrapy安装期间出了点问题。 I get the following output when installing scrapy: 安装scrapy时,我得到以下输出:

Downloading/unpacking scrapy
  Downloading Scrapy-0.24.4-py2-none-any.whl (444kB): 444kB downloaded
Requirement already satisfied (use --upgrade to upgrade): pyOpenSSL in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 in /Library/Python/2.7/site-packages (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): queuelib in /Library/Python/2.7/site-packages (from scrapy)
Downloading/unpacking lxml (from scrapy)
  Downloading lxml-3.4.0.tar.gz (3.5MB): 3.5MB downloaded
  Running setup.py (path:/private/tmp/pip_build_root/lxml/setup.py) egg_info for package lxml
    /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    Building lxml version 3.4.0.
    Building without Cython.
    Using build configuration of libxslt 1.1.28

    warning: no previously-included files found matching '*.py'
Requirement already satisfied (use --upgrade to upgrade): w3lib>=1.8.0 in /Library/Python/2.7/site-packages (from scrapy)
Downloading/unpacking cssselect>=0.9 (from scrapy)
  Downloading cssselect-0.9.1.tar.gz
  Running setup.py (path:/private/tmp/pip_build_root/cssselect/setup.py) egg_info for package cssselect

    no previously-included directories found matching 'docs/_build'
Requirement already satisfied (use --upgrade to upgrade): Twisted>=10.0.0 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from scrapy)
Requirement already satisfied (use --upgrade to upgrade): zope.interface in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from Twisted>=10.0.0->scrapy)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from zope.interface->Twisted>=10.0.0->scrapy)
Installing collected packages: scrapy, lxml, cssselect
  Running setup.py install for lxml
    /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    Building lxml version 3.4.0.
    Building without Cython.
    Using build configuration of libxslt 1.1.28
    building 'lxml.etree' extension
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/include/libxml2 -I/private/tmp/pip_build_root/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace

    You have not agreed to the Xcode license agreements, please run 'xcodebuild -license' (for user-level acceptance) or 'sudo xcodebuild -license' (for system-wide acceptance) from within a Terminal window to review and agree to the Xcode license agreements.
    error: command 'cc' failed with exit status 69
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-3TNhV_-record/install-record.txt --single-version-externally-managed --compile:
    /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'

  warnings.warn(msg)

Building lxml version 3.4.0.

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.9-intel-2.7

creating build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/_elementpath.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/builder.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/cssselect.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/doctestcompare.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/ElementInclude.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/pyclasslookup.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/sax.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/usedoctest.py -> build/lib.macosx-10.9-intel-2.7/lxml

creating build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml/includes

creating build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/_diffcommand.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/_html5builder.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/_setmixin.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/builder.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/clean.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/defs.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/diff.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/ElementSoup.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/formfill.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/html5parser.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/soupparser.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/usedoctest.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron

copying src/lxml/isoschematron/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron

copying src/lxml/lxml.etree.h -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/lxml.etree_api.h -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/includes/c14n.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/config.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/dtdvalid.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/etreepublic.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/htmlparser.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/relaxng.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/schematron.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/tree.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/uri.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xinclude.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xmlerror.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xmlparser.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xmlschema.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xpath.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xslt.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/etree_defs.h -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/lxml-version.h -> build/lib.macosx-10.9-intel-2.7/lxml/includes

creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources

creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/rng

copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/rng

creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl

copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl

copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl

creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.macosx-10.9-intel-2.7/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.9-intel-2.7/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.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

running build_ext

building 'lxml.etree' extension

creating build/temp.macosx-10.9-intel-2.7

creating build/temp.macosx-10.9-intel-2.7/src

creating build/temp.macosx-10.9-intel-2.7/src/lxml

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/include/libxml2 -I/private/tmp/pip_build_root/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace



You have not agreed to the Xcode license agreements, please run 'xcodebuild -license' (for user-level acceptance) or 'sudo xcodebuild -license' (for system-wide acceptance) from within a Terminal window to review and agree to the Xcode license agreements.

error: command 'cc' failed with exit status 69

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-3TNhV_-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/lxml

I also tried to install lxml seperately and get the following output: 我还尝试单独安装lxml并获得以下输出:

Downloading/unpacking lxml
  Downloading lxml-3.4.0.tar.gz (3.5MB): 3.5MB downloaded
  Running setup.py (path:/private/tmp/pip_build_root/lxml/setup.py) egg_info for package lxml
    /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    Building lxml version 3.4.0.
    Building without Cython.
    Using build configuration of libxslt 1.1.28

    warning: no previously-included files found matching '*.py'
Installing collected packages: lxml
  Running setup.py install for lxml
    /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    Building lxml version 3.4.0.
    Building without Cython.
    Using build configuration of libxslt 1.1.28
    building 'lxml.etree' extension
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/include/libxml2 -I/private/tmp/pip_build_root/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace

    You have not agreed to the Xcode license agreements, please run 'xcodebuild -license' (for user-level acceptance) or 'sudo xcodebuild -license' (for system-wide acceptance) from within a Terminal window to review and agree to the Xcode license agreements.
    error: command 'cc' failed with exit status 69
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-l6wwGK-record/install-record.txt --single-version-externally-managed --compile:
    /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'

  warnings.warn(msg)

Building lxml version 3.4.0.

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.9-intel-2.7

creating build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/_elementpath.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/builder.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/cssselect.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/doctestcompare.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/ElementInclude.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/pyclasslookup.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/sax.py -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/usedoctest.py -> build/lib.macosx-10.9-intel-2.7/lxml

creating build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml/includes

creating build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/_diffcommand.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/_html5builder.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/_setmixin.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/builder.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/clean.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/defs.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/diff.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/ElementSoup.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/formfill.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/html5parser.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/soupparser.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

copying src/lxml/html/usedoctest.py -> build/lib.macosx-10.9-intel-2.7/lxml/html

creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron

copying src/lxml/isoschematron/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron

copying src/lxml/lxml.etree.h -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/lxml.etree_api.h -> build/lib.macosx-10.9-intel-2.7/lxml

copying src/lxml/includes/c14n.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/config.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/dtdvalid.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/etreepublic.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/htmlparser.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/relaxng.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/schematron.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/tree.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/uri.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xinclude.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xmlerror.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xmlparser.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xmlschema.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xpath.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/xslt.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/etree_defs.h -> build/lib.macosx-10.9-intel-2.7/lxml/includes

copying src/lxml/includes/lxml-version.h -> build/lib.macosx-10.9-intel-2.7/lxml/includes

creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources

creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/rng

copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/rng

creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl

copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl

copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl

creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.macosx-10.9-intel-2.7/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.9-intel-2.7/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.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

running build_ext

building 'lxml.etree' extension

creating build/temp.macosx-10.9-intel-2.7

creating build/temp.macosx-10.9-intel-2.7/src

creating build/temp.macosx-10.9-intel-2.7/src/lxml

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/include/libxml2 -I/private/tmp/pip_build_root/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace



You have not agreed to the Xcode license agreements, please run 'xcodebuild -license' (for user-level acceptance) or 'sudo xcodebuild -license' (for system-wide acceptance) from within a Terminal window to review and agree to the Xcode license agreements.

error: command 'cc' failed with exit status 69

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-l6wwGK-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/lxml

Can anybody please help? 有人可以帮忙吗?

The problem was this part: 问题是这部分:

You have not agreed to the Xcode license agreements, please run 'xcodebuild -license' (for user-level acceptance) or 'sudo xcodebuild -license' (for system-wide acceptance) from within a Terminal window to review and agree to the Xcode license agreements.

Running sudo xcodebuild -license and reinstalling scrapy solved the problem. 运行sudo xcodebuild -license并重新安装scrapy解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM