当前位置:  开发笔记 > 编程语言 > 正文

获取错误:DLL加载失败:操作系统无法运行%1 - Python 2.7; Scrapy模块; 导入密码学

如何解决《获取错误:DLL加载失败:操作系统无法运行%1-Python2.7;Scrapy模块;导入密码学》经验,为你挑选了2个好方法。

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

安装了Python 2.7,我按照scrapy的安装说明进行操作(http://doc.scrapy.org/en/latest/intro/install.html).我在Windows 7(64位)上运行Python 2.7.6 32位.

安装的其他方面:

    Twisted-13.2.0.dist-info

    zope.interface-4.1.1-py2.7

    Scrapy-0.22.2-py2.7

    lxml-3.3.3-py2.7

    cssselect-0.9.1-py2.7

    cryptography-0.3.dist-info

    pyOpenSSL-0.14-py2.7

    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 
        from scrapy.crawler import CrawlerProcess
      File "C:\Python27\lib\site-packages\scrapy\crawler.py", line 3, in 
        from twisted.internet import reactor, defer
      File "twisted\internet\reactor.py", line 38, in 
        from twisted.internet import default
      File "twisted\internet\default.py", line 56, in 
        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 
        from twisted.internet import posixbase
      File "twisted\internet\posixbase.py", line 24, in 
        from twisted.internet import error, udp, tcp
      File "twisted\internet\tcp.py", line 29, in 
        from twisted.internet._newtls import (
      File "twisted\internet\_newtls.py", line 21, in 
        from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
      File "twisted\protocols\tls.py", line 40, in 
        from OpenSSL.SSL import Error, ZeroReturnError, WantReadError
      File "build\bdist.win32\egg\OpenSSL\__init__.py", line 8, in 
      File "build\bdist.win32\egg\OpenSSL\rand.py", line 11, in 
      File "build\bdist.win32\egg\OpenSSL\_util.py", line 4, in 
      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.**

voetsjoeba.. 6

我有这个问题是由于另一个(较旧的?)版本的libeay32.dll和ssleay32.dll在我自己的OpenSSL 1.0.1g安装之前在PATH上.我建议您使用SysInternals的Process Monitor来监视python.exe以查看它实际加载OpenSSL DLL的位置.

就我而言,罪犯是C:\Program Files (x86)\Intel\iCLS Client\我的驱动程序附带的一些英特尔组件.在PATH环境变量中先前移动我自己的OpenSSL bin目录之后,一切都按预期工作.



1> voetsjoeba..:

我有这个问题是由于另一个(较旧的?)版本的libeay32.dll和ssleay32.dll在我自己的OpenSSL 1.0.1g安装之前在PATH上.我建议您使用SysInternals的Process Monitor来监视python.exe以查看它实际加载OpenSSL DLL的位置.

就我而言,罪犯是C:\Program Files (x86)\Intel\iCLS Client\我的驱动程序附带的一些英特尔组件.在PATH环境变量中先前移动我自己的OpenSSL bin目录之后,一切都按预期工作.



2> 小智..:

我只是重新安装密码术以使其工作.

pip卸载密码学

pip安装加密

推荐阅读
U友50081205_653
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有