简体   繁体   English

Python模块scrapy总是会产生Traceback错误

[英]Python module scrapy always gives Traceback Error

I have some problems with scrapy ( http://scrapy.org/ ), actually it doesn't work. 我在scrapy( http://scrapy.org/ )上遇到了一些问题,实际上它不起作用。 I installed it using 我使用安装

pip install scrapy

on a Windows System with python 3.4.3 installed (with Anaconda3), everything worked fine. 在安装了python 3.4.3的Windows系统(带有Anaconda3)上,一切正常。 It's Scrapy-1.0.5. 是Scrapy-1.0.5。

Then I tried to do the tutorial, but already the first command failed: 然后,我尝试做本教程,但是第一个命令已经失败了:

scrapy startproject tutorial

gives the following Error: 给出以下错误:

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'})

Any ideas about whats wrong here or how to fix it? 关于这里有什么问题或如何解决的任何想法?

I tried out to uninstall and reinstall scrapy, nothing changed. 我尝试卸载并重新安装scrapy,没有任何变化。 Also tried to update it using 还尝试使用更新

pip install -U scrapy

which failes with the error message 失败并显示错误消息

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 

Actually, I have no idea whats the problem here. 实际上,我不知道这里出了什么问题。 It looks like the python parser modules doesnt work here. 看起来python解析器模块在这里不起作用。

Calling Scrapy without any arguments gives the same error message. 不带任何参数调用Scrapy会给出相同的错误消息。

Well I just investigated the problem: Scrapy doesn't support Python 3.4., only Python 2.7. 好吧,我刚刚调查了这个问题:Scrapy不支持Python 3.4。,仅支持Python 2.7。

I could delete this post but maybe someone else in the future will be as dumb as I was and this may help then. 我可以删除这篇文章,但将来也许其他人会像我以前一样愚蠢,这可能会有所帮助。

Thanks and sorry. 谢谢,抱歉。

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

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