python3.6下put_file出问题

>>> ret, info = put_file(token, key, localfile)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/debian8/anaconda3/lib/python3.6/site-packages/qiniu/services/storage/uploader.py", line 62, in put_file
    modify_time=(int)(os.path.getmtime(file_path)))
  File "/home/debian8/anaconda3/lib/python3.6/site-packages/qiniu/services/storage/uploader.py", line 108, in put_stream
    return task.upload()
  File "/home/debian8/anaconda3/lib/python3.6/site-packages/qiniu/services/storage/uploader.py", line 174, in upload
    host = config.get_default('default_zone').get_up_host_by_token(self.up_token)
  File "/home/debian8/anaconda3/lib/python3.6/site-packages/qiniu/zone.py", line 31, in get_up_host_by_token
    up_hosts = self.get_up_host(ak, bucket)
  File "/home/debian8/anaconda3/lib/python3.6/site-packages/qiniu/zone.py", line 50, in get_up_host
    bucket_hosts = self.get_bucket_hosts(ak, bucket)
  File "/home/debian8/anaconda3/lib/python3.6/site-packages/qiniu/zone.py", line 78, in get_bucket_hosts
    scheme_hosts = hosts[self.scheme]
KeyError: 'http'
阅读 2.8k
1 个回答

核对下 ak sk 是否正确,和 bucket 是否同属一个账号

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
logo
七牛云问答
子站问答
访问
宣传栏