Description
After installing/upgrading to kagglesdk 0.1.32, importing the Kaggle
API fails with:
ModuleNotFoundError: No module named 'kagglesdk.competitions.legacy'
This prevents both the Kaggle CLI and the Python API from working.
Environment
- Python: 3.12.13
- kaggle: 2.2.3
- kagglesdk: 0.1.32
Reproduction
kaggle kernels output <kernel-name>
Expected behavior
The Kaggle CLI should run normally and download the kernel output files.
Actual behavior
The import fails because kagglesdk tries to import:
from kagglesdk.competitions.legacy.types.legacy_competition_host_service import EvaluationMetricParameter
but the kagglesdk.competitions.legacy module is missing.
Workaround
Downgrading kagglesdk to 0.1.31 fixes the issue:
pip install kagglesdk==0.1.31
Traceback
Traceback (most recent call last):
File "/usr/local/bin/kaggle", line 5, in <module>
from kaggle.cli import main
File "/usr/local/lib/python3.12/dist-packages/kaggle/__init__.py", line 3, in <module>
from kaggle.api.kaggle_api_extended import KaggleApi
File "/usr/local/lib/python3.12/dist-packages/kaggle/api/kaggle_api_extended.py", line 59, in <module>
from kagglesdk import get_access_token_from_env, KaggleClient, KaggleCredentials, KaggleEnv, KaggleOAuth
File "/usr/local/lib/python3.12/dist-packages/kagglesdk/__init__.py", line 3, in <module>
from kagglesdk.kaggle_client import KaggleClient
File "/usr/local/lib/python3.12/dist-packages/kagglesdk/kaggle_client.py", line 7, in <module>
from kagglesdk.competitions.services.competition_api_service import CompetitionApiClient
File "/usr/local/lib/python3.12/dist-packages/kagglesdk/competitions/services/competition_api_service.py", line 3, in <module>
from kagglesdk.competitions.types.competition_api_service import *
File "/usr/local/lib/python3.12/dist-packages/kagglesdk/competitions/types/competition_api_service.py", line 6, in <module>
from kagglesdk.competitions.types.host_service import CompetitionSettings
File "/usr/local/lib/python3.12/dist-packages/kagglesdk/competitions/types/host_service.py", line 4, in <module>
from kagglesdk.competitions.legacy.types.legacy_competition_host_service import EvaluationMetricParameter
ModuleNotFoundError: No module named 'kagglesdk.competitions.legacy'
Description
After installing/upgrading to
kagglesdk 0.1.32, importing the KaggleAPI fails with:
This prevents both the Kaggle CLI and the Python API from working.
Environment
Reproduction
Expected behavior
The Kaggle CLI should run normally and download the kernel output files.
Actual behavior
The import fails because
kagglesdktries to import:but the
kagglesdk.competitions.legacymodule is missing.Workaround
Downgrading
kagglesdkto0.1.31fixes the issue:Traceback