我在scrapy(http://scrapy.org/)方面遇到了一些问题,实际上它并没有起作用。我用
安装了它pip install scrapy
在安装了python 3.4.3的Windows系统上(使用Anaconda3),一切正常。它的Scrapy-1.0.5。
然后我尝试了教程,但第一个命令失败了:
scrapy startproject tutorial
给出以下错误:
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\setuptools-17.1.1-py3.4.egg\pkg_resources\__init__.py", line 651, in _build_master
File "C:\Anaconda3\lib\site-packages\setuptools-17.1.1-py3.4.egg\pkg_resources\__init__.py", line 952, in require
File "C:\Anaconda3\lib\site-packages\setuptools-17.1.1-py3.4.egg\pkg_resources\__init__.py", line 844, in resolve
pkg_resources.ContextualVersionConflict: (pyasn1 0.1.7 (c:\anaconda3\lib\site-packages), Requirement.parse('pyasn1>=0.1.8'), {'pyasn1-modules'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Anaconda3\Scripts\scrapy-script.py", line 5, in <module>
from pkg_resources import load_entry_point
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
File "C:\Anaconda3\lib\site-packages\setuptools-17.1.1-py3.4.egg\pkg_resources\__init__.py", line 3084, in <module>
File "C:\Anaconda3\lib\site-packages\setuptools-17.1.1-py3.4.egg\pkg_resources\__init__.py", line 3070, in _call_aside
File "C:\Anaconda3\lib\site-packages\setuptools-17.1.1-py3.4.egg\pkg_resources\__init__.py", line 3097, in _initialize_master_working_set
File "C:\Anaconda3\lib\site-packages\setuptools-17.1.1-py3.4.egg\pkg_resources\__init__.py", line 653, in _build_master
File "C:\Anaconda3\lib\site-packages\setuptools-17.1.1-py3.4.egg\pkg_resources\__init__.py", line 666, in _build_from_requirements
File "C:\Anaconda3\lib\site-packages\setuptools-17.1.1-py3.4.egg\pkg_resources\__init__.py", line 844, in resolve
pkg_resources.ContextualVersionConflict: (pyasn1 0.1.7 (c:\anaconda3\lib\site-packages), Requirement.parse('pyasn1>=0.1.8'), {'pyasn1-modules'})
关于这里的错误或如何修复的任何想法?
我尝试卸载并重新安装scrapy,没有任何改变。还尝试使用
更新它pip install -U scrapy
错误消息
Command "C:\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\meyer\\AppData\\Local\\Temp\\pip-build-5zv6_xhq\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\meyer\AppData\Local\Temp\pip-mfxl3hbe-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\meyer\AppData\Local\Temp\pip-build-5zv6_xhq\lxml
实际上,我不知道这里的问题是什么。看起来python解析器模块在这里不起作用。
在没有任何参数的情况下调用Scrapy会产生相同的错误消息。
答案 0 :(得分:0)
我刚刚调查了这个问题: Scrapy不支持Python 3.4。只支持Python 2.7。
我可以删除这篇文章,但也许将来其他人会像我一样愚蠢,这可能会有所帮助。
谢谢,抱歉。