Python 模块 scrapy 总是给出回溯错误
Python module scrapy always gives Traceback Error
我在使用 scrapy (http://scrapy.org/) 时遇到了一些问题,实际上它不起作用。我使用
安装它
pip install scrapy
在安装了 python 3.4.3(使用 Anaconda3)的 Windows 系统上,一切正常。这是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 会给出相同的错误消息。
好吧,我刚刚调查了这个问题:
Scrapy 不支持 Python 3.4.,只支持 Python 2.7.
我可以删除这个 post 但也许将来会有其他人像我一样愚蠢,这可能会有所帮助。
谢谢,抱歉。
我在使用 scrapy (http://scrapy.org/) 时遇到了一些问题,实际上它不起作用。我使用
安装它pip install scrapy
在安装了 python 3.4.3(使用 Anaconda3)的 Windows 系统上,一切正常。这是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 会给出相同的错误消息。
好吧,我刚刚调查了这个问题: Scrapy 不支持 Python 3.4.,只支持 Python 2.7.
我可以删除这个 post 但也许将来会有其他人像我一样愚蠢,这可能会有所帮助。
谢谢,抱歉。