Kaggle API 问题“找不到 kaggle.json.确保它位于......" [英] Kaggle API issue "Could not find kaggle.json. Make sure it's located in......"

查看:198
本文介绍了Kaggle API 问题“找不到 kaggle.json.确保它位于......"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Kaggle API 从 Kaggle 网站提取数据.我正在使用 Ubuntu 18.04.当我输入以下命令时:

I am trying to use the Kaggle API to extract data from the kaggle website. I am using Ubuntu 18.04. When I enter the following command:

kaggle competitions download -c home-credit-default-risk

我收到以下错误:

Traceback (most recent call last):
  File "/home/hduser/anaconda3/bin/kaggle", line 5, in <module>
    from kaggle.cli import main
  File "/home/hduser/anaconda3/lib/python3.7/site-packages/kaggle/__init__.py", line 23, in <module>
    api.authenticate()
  File "/home/hduser/anaconda3/lib/python3.7/site-packages/kaggle/api/kaggle_api_extended.py", line 149, in authenticate
    self.config_file, self.config_dir))
OSError: Could not find kaggle.json. Make sure it's located in /home/hduser/.kaggle/kaggle.json. Or use the environment method.

这很奇怪,因为我将 kaggle.json 文件保存在正确的目录中,并且我已为其授予所有权限.

This is strange because I have the kaggle.json file saved in the correct directory and I have all permissions granted for it.

ls ~/.kaggle

返回:

kaggle.json

我在这里遗漏了什么吗?

Am I missing something here?

推荐答案

我已经解决了这个问题.出于某种原因,以下命令有效,而不是上面发布的命令.

I have solved this. For some reason the following command works and not the one posted above.

~/.local/bin/kaggle competitions download -c home-credit-default-risk

这篇关于Kaggle API 问题“找不到 kaggle.json.确保它位于......"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆