• 5
  • 新人请关照

七牛python sdk 上传报错 'max_retries'

Traceback (most recent call last):
  File "/home/andy/workspace/test/test.py", line 16, in <module>
    print upload_img_qiniu()
  File "/home/andy/workspace/test/test.py", line 13, in upload_img_qiniu
    ret, info = qiniu.put_data(token, key, data)
  File "/usr/lib/python2.7/site-packages/qiniu/services/storage/uploader.py", line 28, in put_data
    return _form_put(up_token, key, data, params, mime_type, crc, progress_handler)
  File "/usr/lib/python2.7/site-packages/qiniu/services/storage/uploader.py", line 71, in _form_put
    r, info = http._post_file(url, data=fields, files={'file': (name, data, mime_type)})
  File "/usr/lib/python2.7/site-packages/qiniu/http.py", line 73, in _post_file
    return _post(url, data, files, None)
  File "/usr/lib/python2.7/site-packages/qiniu/http.py", line 40, in _post
    _init()
  File "/usr/lib/python2.7/site-packages/qiniu/http.py", line 32, in _init
    max_retries=config.get_default('connection_retries'))
TypeError: __init__() got an unexpected keyword argument 'max_retries'

很奇怪的错误,怎么解决
centos7本地测试不错

阅读 1.9k
评论
    1 个回答
    • 5
    • 新人请关照

    这网站很奇怪
    发了那么就,连搜索都搜不到
    不知道是为网站活跃度的问题,还是我等级太低了……
    问题解决了
    没有人回答就自己来吧
    sudo pip install requests --upgrade

    安装结果……
    Uninstalling requests-1.1.0:
    Successfully uninstalled requests-1.1.0
    Successfully installed requests-2.7.0
    应该是因为requests版本过低,其引起的依赖报错

      撰写回答

      登录后参与交流、获取后续更新提醒

      相似问题
      七牛云问答
      合作问答

      七牛云 联合 SegmentFault 共同推出技术问答专区,为开发者们提供社区支持和帮助。在这里,你将直接获得...

      推荐文章