简体   繁体   中英

Python module scrapy always gives Traceback Error

I have some problems with scrapy ( http://scrapy.org/ ), actually it doesn't work. I installed it using

pip install scrapy

on a Windows System with python 3.4.3 installed (with Anaconda3), everything worked fine. It's 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. 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.

Calling Scrapy without any arguments gives the same error message.

Well I just investigated the problem: Scrapy doesn't support Python 3.4., only 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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