You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用kaggle-cli执行kg download时遇'Response' object has no attribute 'soup'错误

Fix for 'Response' object has no attribute 'soup' in kaggle-cli

I've run into this exact error with kaggle-cli before, and it usually boils down to either a compatibility issue with the latest version or a hiccup in how the tool parses Kaggle's response pages. Here are a few fixes you can try right away:

  • Try downloading a specific file first
    Sometimes the bulk download logic in kaggle-cli breaks, but single-file downloads work. Test with one of the dataset files to rule out broader issues:

    kg download -c instacart-market-basket-analysis -f orders.csv
    

    If this works, you can iterate through all file names in the competition to download them one by one, or use a simple script to automate the batch download.

  • Re-authenticate your kaggle-cli session
    Even if you logged in recently, your session might have expired or become corrupted. Re-run the authentication command to refresh it:

    kg auth
    

    Follow the prompts to log in again (you might need to enter your Kaggle username and password once more to re-establish a valid session).

  • Downgrade to a stable older version of kaggle-cli
    The latest version might have introduced a bug with how it parses Kaggle's HTML responses. Roll back to a known-working version like 0.12.2:

    pip uninstall -y kaggle-cli
    pip install kaggle-cli==0.12.2
    

    After downgrading, try your original bulk download command again.

  • Switch to the official Kaggle API (recommended)
    Kaggle-cli is a third-party tool, and the official Kaggle API is more reliable and actively maintained. Here's how to make the switch:

    1. Install the official API:
      pip install kaggle
      
    2. Go to your Kaggle account settings, download the kaggle.json API key file.
    3. Place the file in ~/.kaggle/ (Linux/macOS) or C:\Users\<YourUsername>\.kaggle\ (Windows).
    4. Run the download command to get all competition files in one zip:
      kaggle competitions download -c instacart-market-basket-analysis
      

    You can then extract the zip file to access all the dataset files.

内容的提问来源于stack exchange,提问作者Samarth Agarwal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 06:19:24