简体   繁体   English

scrapy:没有名为win32api的模块(windows)

[英]scrapy : no module named win32api (windows)

I am trying to install and use Scrapy on windows and I am getting the following error. 我试图在Windows上安装和使用Scrapy,我收到以下错误。

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 . 我已经从http://sourceforge.net/projects/pywin32/?source=typ_redirect下载并安装了基于我的python版本的正确的pywin32。

Version and other details. 版本和其他细节。 I have a python 2.7 directory where Python and scripts are present 我有一个python 2.7目录,其中包含Python和脚本

(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. 这是我的python和Scrapy版本。

(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. 如果相关,我在virtualenv(--no-site-packages)中执行此操作。

我能够通过在virtualenv中使用easy_install .exe文件来实现这一点。

easy_install <\path\to\downloaded_file>\pywin32-219.win32-py2.7.exe

Most probably you are installing the wrong bit version. 很可能你正在安装错误的位版本。 Check your Python IDE and install the same bit version of Scrapy. 检查您的Python IDE并安装相同版本的Scrapy。 I think that should help. 我认为这应该有所帮助。

Install the pywin32 module. 安装pywin32模块。 You can use pip command like- 您可以使用pip命令 -

pip install pywin32

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM