python-2.7 - 出现错误 : DLL load failed: The operating system cannot run %1 - Python 2. 7;抓取模块;导入密码学

标签 python-2.7 dll module scrapy

我无法成功运行 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 上的 Python 2.7.6 32 位(64 位) .

安装的其他方面:

  • 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 <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.**
    

    最佳答案

    我只是重新安装密码学以使其工作。

    pip 卸载密码学

    pip 安装密码学

    关于python-2.7 - 出现错误 : DLL load failed: The operating system cannot run %1 - Python 2. 7;抓取模块;导入密码学,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22800768/

    相关文章:

    python - 有没有办法缩短打开 Python 脚本的命令行命令?

    Ruby 从模块导入局部变量

    python - 在 virtualenv 目录中安装模块

    python-2.7 - 获取PySpark中可见节点的数量

    python - nose2 中是否存在 assertRaises(或 assert_raises)

    python - sys.path什么时候修改?

    c# - 从内存中卸载 DLL

    windows - 动态加载exe文件

    java - 将 native 库添加到 java 项目导致链接不满足要求

    java - 如果可能的话,是否有一种工具可以使所有类包都 protected 和最终?