开发者社区> 问答> 正文

求助:scrapy建的第一只蜘蛛:报错

新人一枚,费尽千辛万苦终于在win7下把scrapy安装好,按照文档写出了第一只spider,但运行时还是报错了

我安装的OpenSSL是"egenix-pyopenssl-0.13.3.1.0.1.6.win-amd64-py2.7.msi",在python下import无碍,scrapy也可以在cmd中正常启动和创建项目了。

下面是错误提示,求高手指教:

 

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-0.22.2-py2.7.egg\scrapy\cmdline.py", line 168, in <module>
    execute()
  File "C:\Python27\lib\site-packages\scrapy-0.22.2-py2.7.egg\scrapy\cmdline.py", line 122, in execute
    cmds = _get_commands_dict(settings, inproject)
  File "C:\Python27\lib\site-packages\scrapy-0.22.2-py2.7.egg\scrapy\cmdline.py", line 46, in _get_commands_dict
    cmds = _get_commands_from_module('scrapy.commands', inproject)
  File "C:\Python27\lib\site-packages\scrapy-0.22.2-py2.7.egg\scrapy\cmdline.py", line 29, in _get_commands_from_module
    for cmd in _iter_command_classes(module):
  File "C:\Python27\lib\site-packages\scrapy-0.22.2-py2.7.egg\scrapy\cmdline.py", line 20, in _iter_command_classes
    for module in walk_modules(module_name):
  File "C:\Python27\lib\site-packages\scrapy-0.22.2-py2.7.egg\scrapy\utils\misc.py", line 68, in walk_modules
    submod = import_module(fullpath)
  File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File "C:\Python27\lib\site-packages\scrapy-0.22.2-py2.7.egg\scrapy\commands\bench.py", line 3, in <module>
    from scrapy.tests.mockserver import MockServer
  File "C:\Python27\lib\site-packages\scrapy-0.22.2-py2.7.egg\scrapy\tests\mockserver.py", line 6, in <module>
    from twisted.internet import reactor, defer, ssl
  File "C:\Python27\lib\site-packages\twisted\internet\ssl.py", line 25, in <module>
    from OpenSSL import SSL
  File "build\bdist.win-amd64\egg\OpenSSL\__init__.py", line 8, in <module>

  File "build\bdist.win-amd64\egg\OpenSSL\rand.py", line 11, in <module>
  File "build\bdist.win-amd64\egg\OpenSSL\_util.py", line 3, in <module>
ImportError: No module named cryptography.hazmat.bindings.openssl.binding

 

展开
收起
kun坤 2020-06-14 14:27:35 598 0
1 条回答
写回答
取消 提交回答
  • 分不清堆栈

    错误提示比较明显,缺失cryptography模块 解决方法:pip install cryptography 如果你是pycharm可以setting——>Project:XXXXX——>project Interpreter中右上角点击+号输入cryptography添加

    2020-07-24 17:46:00
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载