kaggle 竞赛子模块在哪里?

Where is the kaggle competitions submodule?

我是kaggle python模块的新手,不了解结构。我正在尝试从示例脚本 here 执行以下命令,但是当我尝试 运行 和 import 时它失败了:

ModuleNotFoundError: No module named 'kaggle.competitions'

我最初使用pip3安装模块并且在我的安装中没有任何错误。此外,我可以 运行 import kaggle 没有错误,我可以使用 kaggle 的命令行界面下载数据集。我查看了 github 存储库,也没有看到名为 competitions 或 competitions.py 的目录。有人可以向我解释我在这里错过了什么步骤以获得 competitions 子模块吗?是否有安装脚本我应该 运行 但没有?

我也试过像这样遍历 kaggle 的子模块:

>>> l = [l for l in pkgutil.walk_packages(path = kaggle.__path__, 
>>> [r[1] for r in l]
['api', 'api.kaggle_api', 'api.kaggle_api_extended', 'api_client', 'cli', 'configuration', 'models', 'models.dataset_column', 'models.dataset_new_request', 'models.dataset_new_version_request', 'models.dataset_upload_file', 'models.error', 'models.kaggle_models_extended', 'models.kernel_push_request', 'models.result', 'rest', 'tests', 'tests.test_authenticate']

但我没有看到任何 competitions 所以不知道从这里去哪里。我欢迎提出建议。 谢谢!

您尝试使用的模块仅在 Kernels 环境中可用,并且特定于该特定竞赛。它是一个自定义模块,用于在 Kernels 环境中与本次比赛的数据集进行交互。

相比之下,您 pip 安装的模块是 Kaggle's public API

我希望这有助于澄清您所看到的行为。