Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

scrapy Import Error: scrapy.core.downloader.handlers.s3.S3DownloadHandler

i have installed scrapy on my windows 7 machine in a virtualenv called scrapy. scrapy startproject works and i made the tutorial from scrapy docs.

if i run

scrapy crawl dmoz

i get following error message:

File "C:\Users\mac\pystuff\scrapy\lib\site-packages\scrapy\utils\misc.py", line 42,in load_object
raise ImportError("Error loading object '%s': %s" % (path, e))
ImportError: Error loading object'scrapy.core.downloader.handlers.s3.S3DownloadHandler': DLL load failed: Could not find the specified module.

TESTS:

python console:

>>> import scrapy
>>> scrapy
>>> <module 'scrapy' from 'C:\Users\mac\pystuff\scrapy\lib\site-packages\scrapy\__init__.pyc'>

scrapy is available

powershell:

PS C: python -m pydoc scrapy.core.downloader.handlers

output:

NAME
scrapy.core.downloader.handlers - Download handlers for different schemes

FILE
c:\users\mac\pystuff\scrapy\lib\site-  packages\scrapy\core\downloader\handlers\__init__.py

PACKAGE CONTENTS
    file
    ftp
    http
    http10
    http11
    s3

CLASSES
    .
    .
    .

all other modules except s3 show the correct pydoc. for example: python -m pydoc scrapy.core.downloader.handlers.file

only s3 gives the import error:

PS C: python -m pydoc scrapy.core.downloader.handlers.s3
PS C: python -m pydoc scrapy.core.downloader.handlers.s3.S3DownloadHandler

output:

problem in scrapy.core.downloader.handlers.s3 - <type 'exceptions.ImportError'>: DLL load failed: Could not find the specified module.
like image 554
Malik Avatar asked May 07 '14 22:05

Malik


People also ask

How do I import a callable object to Scrapy?

New in version 2.4.0. When a setting references a callable object to be imported by Scrapy, such as a class or a function, there are two different ways you can specify that object: from mybot.pipelines.validate import ValidateMyItem ITEM_PIPELINES = { # passing the classname...

What is Project Settings module in Scrapy?

The project settings module is the standard configuration file for your Scrapy project, it’s where most of your custom settings will be populated. For a standard Scrapy project, this means you’ll be adding or changing the settings in the settings.py file created for your project. 4. Default settings per-command

What are the default Default settings for Scrapy tools?

Default settings per-command Each Scrapy tool command can have its own default settings, which override the global default settings. Those custom command settings are specified in the default_settings attribute of the command class. 5. Default global settings

Why does Scrapy not process new requests?

While the sum of the sizes of all responses being processed is above this value, Scrapy does not process new requests. A dict containing the spider contracts enabled in your project, used for testing spiders. For more info see Spiders Contracts. A dict containing the Scrapy contracts enabled by default in Scrapy.


1 Answers

pywin32 was problem package. i ve tried to import it in python console and it could not be found. i copy these 3 packages from C:(yourpythonpath)\Lib\site-packages\pywin32_system32\ to C:(yourpythonpath)\Lib\site-packages\win32\

  1. pythoncom27.dll
  2. pythoncomloader27.dll
  3. pywintype.dll

that solved the problem!

like image 97
Malik Avatar answered Nov 03 '22 21:11

Malik