我正在尝试使用 Kaggle API 从 kaggle 网站中提取数据。我正在使用 Ubuntu 18.04。当我输入以下命令时:
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 文件保存在正确的目录中,并且我拥有所有权限。
ls ~/.kaggle
返回:
kaggle.json
我在这里错过了什么吗?
最佳答案
我有同样的问题。
使用 Google 的 GCP 笔记本,经过多次尝试,我设法解决了如下问题:
通过 Kaggle 平台生成 API 文件(JSON)。
执行:
https://adityashrm21.github.io/Setting-Up-Kaggle/
关于linux - Kaggle API 问题 "Could not find kaggle.json. Make sure it' 位于……”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60822265/