获取错误:DLL加载失败:操作系统无法运行%1 - Python 2.7;刮板模块导入密码学 [英] Getting error: DLL load failed: The operating system cannot run %1 - Python 2.7; Scrapy Module; Importing Cryptography

查看:949
本文介绍了获取错误:DLL加载失败:操作系统无法运行%1 - Python 2.7;刮板模块导入密码学的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在Scrapy教程(http://doc.scrapy.org/en/latest/intro/tutorial.html)中成功运行第一个命令。下面粘贴的代码复制是结果(错误在结尾)。

I cannot sucessfully run the first command in the Scrapy tutorial (http://doc.scrapy.org/en/latest/intro/tutorial.html). The code copy pasted below is the result (with the error at the end).

安装了Python 2.7 ,并按照安装说明进行刮擦(http://doc.scrapy)。组织/ EN /最新/前奏/的Install.html)。我在Windows 7(64位)上运行 Python 2.7.6 32位。安装的其他方面:(1)Twisted-13.2.0.dist-info; (2)zope.interface-4.1.1-py2.7; (3)Scrapy-0.22.2-py2.7; (4)lxml-3.3.3-py2.7; (5)cssselect-0.9.1-py2.7; (6)cryptography-0.3.dist-info; (7)pyOpenSSL-0.14-py2.7; (8)pywin32_system32

Python 2.7 is installed, and I followed the installation instructions for scrapy (http://doc.scrapy.org/en/latest/intro/install.html). I am running Python 2.7.6 32 bit on Windows 7 (64 bit). Other aspects of installation: (1) Twisted-13.2.0.dist-info; (2) zope.interface-4.1.1-py2.7; (3) Scrapy-0.22.2-py2.7; (4) lxml-3.3.3-py2.7; (5) cssselect-0.9.1-py2.7; (6) cryptography-0.3.dist-info; (7) pyOpenSSL-0.14-py2.7; (8) pywin32_system32

C:\Python27\Scripts>scrapy startproject tutorial
    Traceback (most recent call last):
      File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
        "__main__", fname, loader, pkg_name)
      File "C:\Python27\lib\runpy.py", line 72, in _run_code
        exec code in run_globals
      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 "twisted\internet\reactor.py", line 38, in <module>
        from twisted.internet import default
      File "twisted\internet\default.py", line 56, in <module>
        install = _getInstallFunction(platform)
      File "twisted\internet\default.py", line 50, in _getInstallFunction
        from twisted.internet.selectreactor import install
      File "twisted\internet\selectreactor.py", line 18, in <module>
        from twisted.internet import posixbase
      File "twisted\internet\posixbase.py", line 24, in <module>
        from twisted.internet import error, udp, tcp
      File "twisted\internet\tcp.py", line 29, in <module>
        from twisted.internet._newtls import (
      File "twisted\internet\_newtls.py", line 21, in <module>
        from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
      File "twisted\protocols\tls.py", line 40, in <module>
        from OpenSSL.SSL import Error, ZeroReturnError, WantReadError
      File "build\bdist.win32\egg\OpenSSL\__init__.py", line 8, in <module>
      File "build\bdist.win32\egg\OpenSSL\rand.py", line 11, in <module>
      File "build\bdist.win32\egg\OpenSSL\_util.py", line 4, in <module>
      File "C:\Python27\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py",      l3, in __init__
      self._ensure_ffi_initialized()
      File "C:\Python27\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", l9, in _ensure_ffi_initialized libraries)
      File "C:\Python27\lib\site-packages\cryptography\hazmat\bindings\utils.py", line 77, ind_ffi
        ext_package="cryptography",
      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_library
        return self._load_library()
      File "C:\Python27\lib\site-packages\cffi\verifier.py", line 151, in _load_library
        return self._vengine.load_library()
      File "C:\Python27\lib\site-packages\cffi\vengine_cpy.py", line 138, in load_library
        raise ffiplatform.VerificationError(error)

cffi.ffiplatform.VerificationError: importing 'C:\\Python27\\lib\\site-packages\\cryptogr
\_Cryptography_cffi_48bbf0ebx93c91939.pyd': DLL load failed: The operating system cannot
1.**


推荐答案

@ crazyzh1984的方法有点复杂,但他的答案底部的补充是很有用。我在 http://slproweb.com/products/Win32OpenSSL下载Win32 OpenSSL v1.0.1g Light。 html ,然后我可以成功安装pyOpenSSL。

@crazyzh1984's method is a little complex, but his supplement that posted at the bottom of his answer is very useful. I download the "Win32 OpenSSL v1.0.1g Light" at http://slproweb.com/products/Win32OpenSSL.html and then I could install pyOpenSSL successfully.

这篇关于获取错误:DLL加载失败:操作系统无法运行%1 - Python 2.7;刮板模块导入密码学的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆