Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

scrapy : no module named win32api (windows)

I am trying to install and use Scrapy on windows and I am getting the following error.

scrapy-pratice\scrapyenv\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': No module named win32api

I have downloaded and installed the right pywin32, based on my python version, from http://sourceforge.net/projects/pywin32/?source=typ_redirect.

Version and other details. I have a python 2.7 directory where Python and scripts are present

(C:\Python27)

pywin32-wininst.txt file (first few lines)
*** Installation started 2014/11/01 07:56 ***
Source: C:\Users\rajesh\Downloads\pywin32-219.win32-py2.7.exe
999 Root Key: HKEY_LOCAL_MACHINE
020 Reg DB Key: [Software\Microsoft\Windows\CurrentVersion\Uninstall]pywin32-py2.7

And here are my python and Scrapy versions.

(scrapyenv) PS C:\Users\....\hackernews\hackernews> scrapy version -v
Scrapy  : 0.24.4
lxml    : 3.4.0.0
libxml2 : 2.9.0
Twisted : 14.0.2
Python  : 2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]
Platform: Windows-7-6.1.7601-SP1

(scrapyenv) PS C:\Users\....\hackernews\hackernews> python version -v
Python 2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

Are there any environment variables that need to be set for this to work? How can I debug this? I am doing this within a virtualenv (--no-site-packages) if that is relevant.

like image 326
Rajesh Chamarthi Avatar asked Feb 12 '23 16:02

Rajesh Chamarthi


1 Answers

I was able to get this to work by using easy_install .exe file, within my virtualenv.

easy_install <\path\to\downloaded_file>\pywin32-219.win32-py2.7.exe
like image 94
Rajesh Chamarthi Avatar answered Feb 15 '23 09:02

Rajesh Chamarthi