2011-03-15 12 views
1

Scrapy의 튜토리얼 스크립트를 실행하는 동안 Python 2.7에 Scrapy의 최신 버전을 설치했고 (그래도이 버전 사용) 오류가 발생했습니다. 내가 실행 해요 코드는 다음과 같습니다Python의 "Scrapy"사용 중 오류

from scrapy.spider import BaseSpider 

class DmozSpider(BaseSpider): 
    name = "dmoz.org" 
    allowed_domains = ["dmoz.org"] 
    start_urls = [ 
     "http://www.dmoz.org/Computers/Programming/Languages/Python/Books/", 
     "http://www.dmoz.org/Computers/Programming/Languages/Python/Resources/" 
    ] 

    def parse(self, response): 
     filename = response.url.split("/")[-2] 
     open(filename, 'wb').write(response.body) 

오류 :

Traceback (most recent call last): 
    File "C:/Users/Rainey/Desktop/dmoz/spiders/dmoz_spider.py", line 1, in <module> 
    from scrapy.spider import BaseSpider 
    File "C:\Python27\lib\site-packages\scrapy\spider.py", line 7, in <module> 
    from scrapy import log 
    File "C:\Python27\lib\site-packages\scrapy\log.py", line 10, in <module> 
    from twisted.python import log 
ImportError: No module named twisted.python 

튜토리얼 스크립트는 내 바탕 화면에 있습니다. 이 효과와 다른 장소에서 사용해야합니까?

답변

5

오류 메시지 'ImportError : 모듈 twisted.python'이 (가) twisted 모듈이 누락되었음을 나타냅니다.

pip 또는 download a Windows binary과 같은 패키지 관리자를 사용하여 연선을 설치하십시오.

2

Windows에서 치료를 성공적으로 설치하지 않았습니다. 다음 단계는 당신이 창문에 치료 0.14 (최신)를 설치하는 데 도움이됩니다.

  1. windows installer here을 사용하여 lxml-2.3을 설치하십시오. libxml 시도했지만 작동하지 않습니다.
  2. Windows 설치 프로그램을 사용하여 Twisted-12.0.0을 설치하십시오. here
  3. zope.interface를 Mingw32와 함께 설치할지 여부를 지정하십시오.
  4. 는 갈 준비가있다 "scrapy를 설치 PIP "Windows 설치를 here
  5. 실행을 사용하여 pyOpenSSL 0.13을 설치합니다!

희망이 있습니다.

+0

Zope 인터페이스 https://pypi.python.org/pypi/zope.interface#download – fedmich