Python:试图使用Scrapy,得到了这个错误…帮助我理解这个?

Python:试图使用Scrapy,得到了这个错误…帮助我理解这个?,python,python-3.x,scrapy,scrapy-spider,Python,Python 3.x,Scrapy,Scrapy Spider,当我尝试导入Scrapy时,会出现此错误。有人知道如何解决这个问题吗?我试着重新安装和卸载Scrapy,但没有成功。我是一个亲戚。感谢您的帮助 File "/Library/Frameworks/Python.framework/Versions/3.5/bin/scrapy", line 9, in <module> load_entry_point('Scrapy==1.0.4', 'console_scripts', 'scrapy')() File "/Libra

当我尝试导入Scrapy时,会出现此错误。有人知道如何解决这个问题吗?我试着重新安装和卸载Scrapy,但没有成功。我是一个亲戚。感谢您的帮助

File "/Library/Frameworks/Python.framework/Versions/3.5/bin/scrapy", line 9, in <module>
    load_entry_point('Scrapy==1.0.4', 'console_scripts', 'scrapy')()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/__init__.py", line 549, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2709, in load_entry_point
    return ep.load()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2369, in load
    return self.resolve()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2375, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/scrapy/__init__.py", line 48, in <module>
    from scrapy.spiders import Spider
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/scrapy/spiders/__init__.py", line 10, in <module>
    from scrapy.http import Request
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/scrapy/http/__init__.py", line 11, in <module>
    from scrapy.http.request.form import FormRequest
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/scrapy/http/request/form.py", line 9, in <module>
    import lxml.html
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/lxml/html/__init__.py", line 54, in <module>
    from .. import etree
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/lxml/etree.cpython-35m-darwin.so, 2): Library not loaded: libxml2.2.dylib
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/lxml/etree.cpython-35m-darwin.so
  Reason: Incompatible library version: etree.cpython-35m-darwin.so requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0
文件“/Library/Frameworks/Python.framework/Versions/3.5/bin/scrapy”,第9行,在
加载入口点('Scrapy==1.0.4','console\u scripts','Scrapy')()
文件“/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site packages/pkg_resources/_init__.py”,第549行,加载入口点
返回获取分布(dist)。加载入口点(组、名称)
文件“/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site packages/pkg_resources/_init__.py”,第2709行,在加载入口点
返回ep.load()
文件“/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_-resources/_-init__.py”,第2369行,已加载
返回self.resolve()
文件“/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_-resources/_-init__.py”,第2375行,解析
module=\uuuu导入(self.module\u name,fromlist=[''\uuuu name\uuuuuuu'],级别=0)
文件“/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site packages/scrapy/__init___;.py”,第48行,在
从scrapy.Spider进口蜘蛛
文件“/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site packages/scrapy/spiders/_init____;.py”,第10行
从scrapy.http导入请求
文件“/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/scrapy/http/_-init___;.py”,中的第11行
从scrapy.http.request.form导入FormRequest
文件“/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site packages/scrapy/http/request/form.py”,第9行,在
导入lxml.html
文件“/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/lxml/html/_-init___;.py”,第54行,在
从…起导入etree
导入错误:dlopen(/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/lxml/etree.cpython-35m-darwin.so,2):未加载库:libxml2.2.dylib
引用自:/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/lxml/etree.cpython-35m-darwin.so
原因:不兼容的库版本:etree.cpython-35m-darwin.so需要版本12.0.0或更高版本,但libxml2.2.dylib提供版本10.0.0

scrapy
还不支持python3,请使用
virtualenv
设置本地python2环境