我已经(据我所知)正确安装了Scrapy的所有依赖项。我正在Windows Vista 64位上运行Scrapy.org(Python的64位版本)。到目前为止,我已经安装了:
Visual C ++可再发行组件(64位)
Win32 Open SSL(按照上面的说明将DLL复制到bin目录)
为C:\ Python27,C:\ Python27 \ Scripts和openssl-win32 \ bin添加了环境变量
Visual C ++ Studio 2008年
Pywin32
佐佩
扭曲的
xml文件
pyopenSSL
w3lib
这是我使Scrapy正常运行所需的完整列表吗?到目前为止,当我尝试运行命令时:
scrapy startproject myproject
我在Command Shell中收到以下错误:
Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\Users\Oleg Salenko>scrapy startproject mrscrap
Traceback (most recent call last):
File "c:\Python27\Scripts\scrapy", line 3, in <module>
from scrapy.cmdline import execute
File "c:\Python27\lib\site-packages\scrapy\cmdline.py", line 9, in <module>
from scrapy.crawler import CrawlerProcess
File "c:\Python27\lib\site-packages\scrapy\crawler.py", line 3, in <module>
from twisted.internet import reactor, defer
File "c:\Python27\lib\site-packages\twisted\internet\reactor.py", line 38, in
<module>
from twisted.internet import default
File "c:\Python27\lib\site-packages\twisted\internet\default.py", line 56, in
<module>
install = _getInstallFunction(platform)
File "c:\Python27\lib\site-packages\twisted\internet\default.py", line 50, in
_getInstallFunction
from twisted.internet.selectreactor import install
File "c:\Python27\lib\site-packages\twisted\internet\selectreactor.py", line 1
8, in <module>
from twisted.internet import posixbase
File "c:\Python27\lib\site-packages\twisted\internet\posixbase.py", line 24, i
n <module>
from twisted.internet import error, udp, tcp
File "c:\Python27\lib\site-packages\twisted\internet\tcp.py", line 29, in <mod
ule>
from twisted.internet._newtls import (
File "c:\Python27\lib\site-packages\twisted\internet\_newtls.py", line 21, in
<module>
from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
File "c:\Python27\lib\site-packages\twisted\protocols\tls.py", line 41, in <mo
dule>
from OpenSSL.SSL import Error, ZeroReturnError, WantReadError
File "c:\Python27\lib\site-packages\OpenSSL\__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "c:\Python27\lib\site-packages\OpenSSL\rand.py", line 11, in <module>
from OpenSSL._util import (
File "c:\Python27\lib\site-packages\OpenSSL\_util.py", line 4, in <module>
binding = Binding()
File "c:\Python27\lib\site-packages\cryptography\hazmat\bindings\openssl\bindi
ng.py", line 87, in __init__
self._ensure_ffi_initialized()
File "c:\Python27\lib\site-packages\cryptography\hazmat\bindings\openssl\bindi
ng.py", line 106, in _ensure_ffi_initialized
libraries=libraries,
File "c:\Python27\lib\site-packages\cryptography\hazmat\bindings\utils.py", li
ne 80, in build_ffi
extra_link_args=extra_link_args,
File "c:\Python27\lib\site-packages\cffi\api.py", line 341, in verify
lib = self.verifier.load_library()
File "c:\Python27\lib\site-packages\cffi\verifier.py", line 75, in load_librar
y
return self._load_library()
File "c:\Python27\lib\site-packages\cffi\verifier.py", line 151, in _load_libr
ary
return self._vengine.load_library()
File "c:\Python27\lib\site-packages\cffi\vengine_cpy.py", line 138, in load_li
brary
raise ffiplatform.VerificationError(error)
cffi.ffiplatform.VerificationError: importing 'c:\\Python27\\lib\\site-packages\
\cryptography\\_Cryptography_cffi_444d7397xa22f8491.pyd': DLL load failed: %1 is
not a valid Win32 application.
C:\Users\Oleg Salenko>
谁能看到导致这些错误的原因?我对Python还是很陌生,到目前为止,Scrapy是我为获得工作所做的最艰难的尝试。
谢谢
最佳答案
通过安装64位而不是32位的OpenSSL可以解决此问题。有点小学生错误,但我很高兴能够找到根本原因!
关于python - 安装Scrapy时出现问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/24538263/