24

I am a new learner of Scrapy. I installed python 2.7 and all other engines needed.

Then I tried to build a Scrapy project following the tutorial http://doc.scrapy.org/en/latest/intro/tutorial.html.

In the crawling step, after I typed scrapy crawl dmoz it generated this error message

ImportError: No module named win32api.
[twisted] CRITICAL : Unhandled error in deferred

I am using Windows.

Stack trace:

enter image description here
I am using Windows.

NightShadeQueen
  • 3,284
  • 3
  • 24
  • 37
李皓伟
  • 279
  • 1
  • 2
  • 3
  • the version of my Scrapy 1.0.3. And aslo [twisted] CRITICAL : Unhandled error in defferred: – 李皓伟 Sep 15 '15 at 12:47
  • Are you on Windows or Linux? – Remi Guan Sep 15 '15 at 12:49
  • 1
    Perhaps you could try installing win32api. – Kevin Sep 15 '15 at 12:49
  • I run this on windows – 李皓伟 Sep 15 '15 at 12:49
  • 1
    As stated in the installation guide, you should install `pywin32`. http://doc.scrapy.org/en/latest/intro/install.html – Dean Fenster Sep 15 '15 at 12:51
  • How to install win32api – 李皓伟 Sep 15 '15 at 12:54
  • 3
    Not sure why this question got downvotes...even in 2017 the scrapyd tutorial does not mention needing win32api or installing pywin32. I hit the same issue as 李皓伟 ran into. Thanks to this question my problem was solved. I think the bigger issue is that I came into the installation from http://scrapyd.readthedocs.io/en/stable/install.html instead of the other linked docs which have way more detail. Also, the linked documents don't mention pywin32 in my quick page search. – fujiiface Apr 25 '17 at 21:45
  • Ran into the same problem, and google search led me here. – Moondra May 17 '17 at 20:38
  • yeah, Im upvoting this question, as the oficcial installation guide doesnt mentions the pypiwin32 module. Tho it recommends installing scrapy with conga, so maybe that's why. Either way, this is a good question and it has helped a lot of people. – Silver Feb 07 '18 at 14:15

3 Answers3

62

Try this.

pip install pypiwin32

3

If you search a bit along the internet you will find the following documentation which describes what you have to do to install Py32Win: http://www.feedbackward.com/content/scrapy_install.pdf

Here are all the steps described you have to do. I did it with this document and now my Scrapy installation works on Windows.

GHajba
  • 3,665
  • 5
  • 25
  • 35
0

I was getting the error

An Error Occured while trying to start the kernel in the Spyder IDE and my error said 'No module named win32api'

My console/kernel was fixed by installing pypiwin32 by putting pip install pypiwin32 into the Python Command Prompt

Giulio Caccin
  • 2,962
  • 6
  • 36
  • 57
JArcherB
  • 11
  • 4