wyx
wyx

Reputation: 3534

I can`t run my scrapy1.0.3

>>>import scrapy
 Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\SoftWare\Python27\lib\site-packages\scrapy\__init__.py", line 56, in
<module>
    from scrapy.spider import Spider
  File "D:\SoftWare\Python27\lib\site-packages\scrapy\spider.py", line 7, in <mo
dule>
    from scrapy.http import Request
  File "D:\SoftWare\Python27\lib\site-packages\scrapy\http\__init__.py", line 11
, in <module>
    from scrapy.http.request.form import FormRequest
  File "D:\SoftWare\Python27\lib\site-packages\scrapy\http\request\form.py", lin
e 9, in <module>
    import lxml.html
  File "D:\SoftWare\Python27\lib\site-packages\lxml\html\__init__.py", line 42,
in <module>
    from lxml import etree
ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。

This is what I had installed :pip list

aniso8601 (1.0.0)
cffi (1.2.1)
characteristic (14.3.0)
cryptography (1.0.1)
cssselect (0.9.1)
enum34 (1.0.4)
field (0.2.0)
Flask (0.10.1)
Flask-RESTful (0.3.4)
Flask-Script (2.0.5)
Flask-SQLAlchemy (2.0)
idna (2.0)
ipaddress (1.0.14)
item (0.0.3)
itsdangerous (0.24)
Jinja2 (2.8)
libxml2-python (2.7.7)
lxml (3.4.4)
MarkupSafe (0.23)
mysql-connector-python (2.0.4)
MySQL-python (1.2.5)
PIL (1.1.7)
Pillow (2.9.0)
pip (7.1.2)
pyasn1 (0.1.8)
pyasn1-modules (0.0.7)
pycparser (2.14)
pyOpenSSL (0.15.1)
pytils (0.3)
pytz (2015.4)
pywin32 (219)
queuelib (1.4.2)
requests (2.7.0)
Scrapy (1.0.3)
selection (0.0.11)
service-identity (14.0.0)
setuptools (18.3.2)
six (1.9.0)
SQLAlchemy (1.0.8)
Twisted (15.4.0)
w3lib (1.12.0)
weblib (0.1.15)
Werkzeug (0.10.4)
WTForms (2.0.2)
zope.interface (4.1.2)

My system is WIN7 x64 , Python 2.7.10 win32 I think I had already installed what Scrapy require but I can`t run it. I had tried to install 0.24.2 (lower version) but the problem can not be sloved

Upvotes: 0

Views: 189

Answers (1)

GHajba
GHajba

Reputation: 3691

The solution is that you need some other requirements to install when using Scrapy on Windows because of a Bug of Twisted. You can read more about it in the docs.

If you go through all the steps you will see that you need to install pywin32 too. Alternatively you can look at the installation instructions here because it is sometimes a bit more complicated. I used this doc for Windows and it works.

Upvotes: 1

Related Questions