diff --git a/scrapy/__init__.py b/scrapy/__init__.py index 2c7539bcf..d0401c281 100644 --- a/scrapy/__init__.py +++ b/scrapy/__init__.py @@ -16,8 +16,11 @@ warnings.filterwarnings('ignore', category=DeprecationWarning, module='twisted') # prevents noisy (and innocent) dropin.cache errors when loading spiders from # egg files using the old Spider Manager. TODO: Remove for Scrapy 0.11 -from twisted.python.zippath import ZipPath -ZipPath.setContent = lambda x, y: None +try: + from twisted.python.zippath import ZipPath + ZipPath.setContent = lambda x, y: None +except ImportError: # to avoid making setup.py depend on Twisted + pass # monkey patches to fix external library issues from scrapy.xlib import twisted_250_monkeypatches, urlparse_monkeypatches