Scrapy-创建项目时出错-DDL加载失败

时间:2018-07-14 02:41:33

标签: python scrapy

我正在尝试更长的时间。请提供帮助。 我使用conda安装了scrapy。 我在命令行中测试了 pip show scrapy ,它运行良好。 当我在python终端中键入 import scrapy 时,它没有显示任何错误。 但是,如果我创建一个项目或执行现有的scrapy项目,则会收到以下错误:

C:\Users\Nikeshh\Anaconda2\lib\site-packages\scrapy\commands\deploy.py:16: ScrapyDeprecationWarning: Module `scrapy.command` is deprecated, use `scrapy.commands` instead
  from scrapy.command import ScrapyCommand
Traceback (most recent call last):
  File "C:\Users\Nikeshh\Anaconda2\Scripts\scrapy-script.py", line 10, in <module>
    sys.exit(execute())
  File "C:\Users\Nikeshh\Anaconda2\lib\site-packages\scrapy\cmdline.py", line 149, in execute
    cmd.crawler_process = CrawlerProcess(settings)
  File "C:\Users\Nikeshh\Anaconda2\lib\site-packages\scrapy\crawler.py", line 252, in __init__
    log_scrapy_info(self.settings)
  File "C:\Users\Nikeshh\Anaconda2\lib\site-packages\scrapy\utils\log.py", line 149, in log_scrapy_info
    for name, version in scrapy_components_versions()
  File "C:\Users\Nikeshh\Anaconda2\lib\site-packages\scrapy\utils\versions.py", line 35, in scrapy_components_versions
    ("pyOpenSSL", _get_openssl_version()),
  File "C:\Users\Nikeshh\Anaconda2\lib\site-packages\scrapy\utils\versions.py", line 43, in _get_openssl_version
    import OpenSSL
  File "C:\Users\Nikeshh\Anaconda2\lib\site-packages\OpenSSL\__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "C:\Users\Nikeshh\Anaconda2\lib\site-packages\OpenSSL\crypto.py", line 16, in <module>
    from OpenSSL._util import (
  File "C:\Users\Nikeshh\Anaconda2\lib\site-packages\OpenSSL\_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "C:\Users\Nikeshh\Anaconda2\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 13, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: DLL load failed: The operating system cannot run %1.

我正在使用 scrapy startproject教程创建项目。如何解决此错误? 有什么特定的方法可以执行scrapy代码吗? 即使当我使用conda添加openssl时,我也遇到相同的错误

1 个答案:

答案 0 :(得分:0)

您似乎需要用于加密的OpenSSL库。

您可以从以下位置下载这些文件:https://wiki.openssl.org/index.php/Binaries

或者,我认为git的安装程序将默认安装OpenSSL,您可以在此处获得:https://git-scm.com/download

但是,由于您使用的是Anaconda,因此OpenSSL也应随conda一起提供:https://anaconda.org/anaconda/openssl

希望这会有所帮助!