求助:scrapy建的第一只蜘蛛

秋天的小飞 发布于 2014/03/27 18:05
阅读 4K+
收藏 0

新人一枚,费尽千辛万苦终于在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

 

加载中
0
小心有诈
小心有诈

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

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

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

0
秋天的小飞

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

0
waitalone
waitalone

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

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

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

返回顶部
顶部