Scrapy:无法创建项目

时间:2018-11-09 19:22:39

标签: python scrapy

我目前正在遵循Scrapy教程,并且处于创建项目的步骤,但是,每当我运行命令scrapy startproject tutorial时,都会产生此错误。

错误:

Traceback (most recent call last):
  File "C:\Users\Me\Miniconda3\Scripts\scrapy-script.py", line 10, in <module>
    sys.exit(execute())
  File "C:\Users\Me\Miniconda3\lib\site-packages\scrapy\cmdline.py", line 149, in execute
    cmd.crawler_process = CrawlerProcess(settings)
  File "C:\Users\Me\Miniconda3\lib\site-packages\scrapy\crawler.py", line 252, in __init__
    log_scrapy_info(self.settings)
  File "C:\Users\Me\Miniconda3\lib\site-packages\scrapy\utils\log.py", line 149, in log_scrapy_info
    for name, version in scrapy_components_versions()
  File "C:\Users\Me\Miniconda3\lib\site-packages\scrapy\utils\versions.py", line 35, in scrapy_components_versions
    ("pyOpenSSL", _get_openssl_version()),
  File "C:\Users\Me\Miniconda3\lib\site-packages\scrapy\utils\versions.py", line 43, in _get_openssl_version
    import OpenSSL
  File "C:\Users\Me\Miniconda3\lib\site-packages\OpenSSL\__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "C:\Users\Me\Miniconda3\lib\site-packages\OpenSSL\crypto.py", line 16, in <module>
    from OpenSSL._util import (
  File "C:\Users\Me\Miniconda3\lib\site-packages\OpenSSL\_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "C:\Users\Me\Miniconda3\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 specified procedure could not be found.

我怀疑问题出在我的Scrapy安装中,因此我尝试重新安装Scrapy(首先通过pip,然后通过conda),但仍然无法解决问题。然后,我尝试安装Scrapy所需的软件包(一个接一个),但仍然无法解决任何问题。

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

您可以尝试安装Win64OpenSSL_Light-1_0_2h并重新安装cryptography吗?

pip install -I cryptography

请参阅此existing answer