2015-09-21 35 views
0
>>>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 應用程序。 

這是我已經安裝:PIP列表我不能老是跑我scrapy1.0.3

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) 

我的系統是WIN7 64位,巨蟒2.7.10 win32的 我想我已經安裝了Scrapy需要的東西,但我不能運行它。 我曾嘗試安裝0.24.2(較低版本),但問題無法解決

+0

您能否將錯誤信息'DLL load failed:%1不是有效的Win32應用程序.'翻譯成英文? – BrokenBinary

+0

您可以從Microsoft獲得Sysinternals工具,並使用Process Monitor記錄所有Python的活動,以瞭解加載該庫時發生的情況。 –

+0

可能重複的[ImportError:DLL加載失敗:%1不是有效的Win32應用程序。但是DLL的存在](http://stackoverflow.com/questions/19019720/importerror-dll-load-failed-1-is-not-a-valid-win32-application-but-the-dlls) –

回答

1

解決方法是,由於Twisted錯誤,在Windows上使用Scrapy時需要安裝其他一些要求。您可以在docs中閱讀更多關於它的信息。

如果你經歷了所有的步驟,你會發現你也需要安裝pywin32。或者,您可以查看安裝說明here,因爲它有時會更復雜一些。我用這個文件的Windows和它的作品。

+0

當我安裝pywin32時,32位遵循你的建議,'Traceback最近調用最後一個):文件「」,行408,安裝文件「」,行221,在RegisterPythonwin WindowsError:[錯誤5]文件對象析構函數關閉失敗:sys.excepthook丟失丟失sys.stderr * *如何解決它你能幫助我**其他要求,如openSSL,Twisted,zope.interface .....我已經安裝。 – wyx

+0

你是否從這裏安裝了手冊:http://www.feedbackward.com/content/scrapy_install.pdf? – GHajba