24
votes

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.

3
the version of my Scrapy 1.0.3. And aslo [twisted] CRITICAL : Unhandled error in defferred: - 李皓伟
Are you on Windows or Linux? - Casimir Crystal
Perhaps you could try installing win32api. - Kevin
As stated in the installation guide, you should install pywin32. doc.scrapy.org/en/latest/intro/install.html - Dean Fenster
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 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

3 Answers

62
votes

Try this.

pip install pypiwin32

3
votes

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.

0
votes

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