V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
chendajun
V2EX  ›  Python

scrapy_redis 报错

  •  
  •   chendajun · 2016-06-10 19:56:49 +08:00 · 2687 次点击
    这是一个创建于 3099 天前的主题,其中的信息可能已经有所发展或是发生改变。
    用 scrapy_redis 作为 scrapy 爬虫的排重数据库,之前用 Python2.x 没问题,现在想升级到 Python3.5 报了个错误,报错如下:[2016-06-10 19:44:35,905]CRITICAL:Unhandled Error
    Traceback (most recent call last):
    File "d:\python3.5.1\lib\site-packages\scrapy\commands\crawl.py", line 58, in run
    self.crawler_process.start()
    File "d:\python3.5.1\lib\site-packages\scrapy\crawler.py", line 280, in start
    reactor.run(installSignalHandlers=False) # blocking call
    File "d:\python3.5.1\lib\site-packages\twisted\internet\base.py", line 1194, in run
    self.mainLoop()
    File "d:\python3.5.1\lib\site-packages\twisted\internet\base.py", line 1203, in mainLoop
    self.runUntilCurrent()
    --- <exception caught here> ---
    File "d:\python3.5.1\lib\site-packages\twisted\internet\base.py", line 825, in runUntilCurrent
    call.func(*call.args, **call.kw)
    File "d:\python3.5.1\lib\site-packages\scrapy\utils\reactor.py", line 41, in __call__
    return self._func(*self._a, **self._kw)
    File "d:\python3.5.1\lib\site-packages\scrapy\core\engine.py", line 134, in _next_request
    self.crawl(request, spider)
    File "d:\python3.5.1\lib\site-packages\scrapy\core\engine.py", line 209, in crawl
    self.schedule(request, spider)
    File "d:\python3.5.1\lib\site-packages\scrapy\core\engine.py", line 215, in schedule
    if not self.slot.scheduler.enqueue_request(request):
    File "d:\python3.5.1\lib\site-packages\scrapy_redis\scheduler.py", line 78, in enqueue_request
    self.queue.push(request)
    File "d:\python3.5.1\lib\site-packages\scrapy_redis\queue.py", line 83, in push
    self.server.zadd(self.key, **pairs)
    builtins.TypeError: zadd() keywords must be strings
    新手,不知道咋解决。
    4 条回复    2017-12-16 17:08:07 +08:00
    mkeith
        1
    mkeith  
       2016-06-11 13:20:34 +08:00
    zadd() keywords must be strings
    Jimmy93
        2
    Jimmy93  
       2017-12-16 17:06:36 +08:00
    TypeError: zadd() keywords must be strings
    Jimmy93
        3
    Jimmy93  
       2017-12-16 17:07:10 +08:00
    TypeError: zadd() keywords must be strings
    这个都能看懂,但是要怎么修改?
    Jimmy93
        4
    Jimmy93  
       2017-12-16 17:08:07 +08:00
    是因为不支持 py3 吗?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5876 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 02:37 · PVG 10:37 · LAX 18:37 · JFK 21:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.