开发者社区> 问答> 正文

求助: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

 

展开
收起
爱吃鱼的程序员 2020-06-22 11:16:40 313 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    这个比较坑爹,当初也困扰了我几个小时,在谷歌上翻了一堆

    最开始我是用easy_install去安装 cryptography,结果出现这个问题,后来找到说用pip安装 cryptography就行了.

    BTW:windows玩这个纯粹折磨自己,还是去linux下吧

    谢了,这个确实是折磨,不敢玩了

    请参考此文章,瞬间安装好scrapy。

    http://www.waitalone.cn/python-scrapy-install.html

    我也是研究了几天才安装好。。。

    2020-06-22 11:16:55
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

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