{
  "id": 173294,
  "title": "How can I install kaggle_datasets module?",
  "url": "/competitions/siim-isic-melanoma-classification/discussion/173294",
  "author_name": "Vadim Timakin",
  "post_date": "2020-08-08T16:22:43.300000",
  "votes": 2,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Does anyone know how can I install the kaggle_datasets module in the Google Colab? I faced this problem trying to run <a href=\"https://www.kaggle.com/cdeotte/triple-stratified-kfold-with-tfrecords\">this notebook</a> by @cdeotte in the Google Colab. There is just no such module in the colab environment. I've successfully installed the Kaggle module itself but I still can't use the kaggle_datasets module.</p>\n\n<p>Here is the import string of code which causes an error:\n<code>from kaggle_datasets import KaggleDatasets</code></p>",
  "messages": [
    {
      "id": 963170,
      "postDate": "2020-08-08T18:11:27.377Z",
      "content": "<p>You need to run kaggle datasets here on local notebook, print the variable it'll be something like this:</p>\n<p><code>'gs://kds-xxxxxxxxxxxxxxxxxxxxxx'</code> x=some numbers</p>\n<p>Copy it and paste it on colab where you used <code>KaggleDatasets().get_gcs_path</code> on kaggle. Instead of loader command you have the GCS bucket address as string.</p>",
      "rawMarkdown": "You need to run kaggle datasets here on local notebook, print the variable it'll be something like this:\n\n`'gs://kds-xxxxxxxxxxxxxxxxxxxxxx'` x=some numbers\n\nCopy it and paste it on colab where you used `KaggleDatasets().get_gcs_path` on kaggle. Instead of loader command you have the GCS bucket address as string.",
      "votes": 3
    },
    {
      "id": 963154,
      "postDate": "2020-08-08T17:50:02.370Z",
      "content": "<p>To the best of my knowledge, you cannot install this module outside of Kaggle. So, the workaround is this: run <code>KaggleDatasets</code> on Kaggle to learn the GCS bucket addresses of the datasets of your interest and then use these addresses on Colab. You can store them in some kind of dictionary: <code>GCS['train']='...'</code>, <code>GCS['test']='...'</code>. Also, you will need to update these addresses periodically (once in 5-7 days) because they change.</p>",
      "rawMarkdown": "To the best of my knowledge, you cannot install this module outside of Kaggle. So, the workaround is this: run `KaggleDatasets` on Kaggle to learn the GCS bucket addresses of the datasets of your interest and then use these addresses on Colab. You can store them in some kind of dictionary: `GCS['train']='...'`, `GCS['test']='...'`. Also, you will need to update these addresses periodically (once in 5-7 days) because they change.",
      "votes": 1,
      "replies": [
        {
          "id": 963166,
          "postDate": "2020-08-08T18:10:02.817Z",
          "rawMarkdown": "",
          "isDeleted": true
        }
      ]
    },
    {
      "id": 963054,
      "postDate": "2020-08-08T16:22:43.300Z",
      "content": "<p>Does anyone know how can I install the kaggle_datasets module in the Google Colab? I faced this problem trying to run <a href=\"https://www.kaggle.com/cdeotte/triple-stratified-kfold-with-tfrecords\">this notebook</a> by @cdeotte in the Google Colab. There is just no such module in the colab environment. I've successfully installed the Kaggle module itself but I still can't use the kaggle_datasets module.</p>\n\n<p>Here is the import string of code which causes an error:\n<code>from kaggle_datasets import KaggleDatasets</code></p>",
      "rawMarkdown": "Does anyone know how can I install the kaggle\\_datasets module in the Google Colab? I faced this problem trying to run [this notebook](https://www.kaggle.com/cdeotte/triple-stratified-kfold-with-tfrecords) by @cdeotte in the Google Colab. There is just no such module in the colab environment. I've successfully installed the Kaggle module itself but I still can't use the kaggle_datasets module.\n\nHere is the import string of code which causes an error:\n`from kaggle_datasets import KaggleDatasets`\n",
      "votes": 2
    },
    {
      "id": 963242,
      "postDate": "2020-08-08T19:32:58.623Z",
      "content": "<p>Right, there is no official Kaggle support for this. Despite this, I have developed a solution that works for both Kaggle and Colab - described here: <a href=\"https://www.kaggle.com/wrrosa/gcs-bucket-addresses-utility-package\">here</a>. (required kaggle API key connected with your account)</p>",
      "rawMarkdown": "Right, there is no official Kaggle support for this. Despite this, I have developed a solution that works for both Kaggle and Colab - described here: [here](https://www.kaggle.com/wrrosa/gcs-bucket-addresses-utility-package). (required kaggle API key connected with your account)"
    }
  ],
  "comments": [
    {
      "id": 963170,
      "author_name": "Ertuğrul Demir",
      "author_url": "",
      "post_date": "2020-08-08T18:11:27.377000",
      "content": "<p>You need to run kaggle datasets here on local notebook, print the variable it'll be something like this:</p>\n<p><code>'gs://kds-xxxxxxxxxxxxxxxxxxxxxx'</code> x=some numbers</p>\n<p>Copy it and paste it on colab where you used <code>KaggleDatasets().get_gcs_path</code> on kaggle. Instead of loader command you have the GCS bucket address as string.</p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 963154,
      "author_name": "Alexey Pronin",
      "author_url": "",
      "post_date": "2020-08-08T17:50:02.370000",
      "content": "<p>To the best of my knowledge, you cannot install this module outside of Kaggle. So, the workaround is this: run <code>KaggleDatasets</code> on Kaggle to learn the GCS bucket addresses of the datasets of your interest and then use these addresses on Colab. You can store them in some kind of dictionary: <code>GCS['train']='...'</code>, <code>GCS['test']='...'</code>. Also, you will need to update these addresses periodically (once in 5-7 days) because they change.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 963166,
          "author_name": "",
          "author_url": "",
          "post_date": "2020-08-08T18:10:02.817000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 963242,
      "author_name": "Wojtek Rosa",
      "author_url": "",
      "post_date": "2020-08-08T19:32:58.623000",
      "content": "<p>Right, there is no official Kaggle support for this. Despite this, I have developed a solution that works for both Kaggle and Colab - described here: <a href=\"https://www.kaggle.com/wrrosa/gcs-bucket-addresses-utility-package\">here</a>. (required kaggle API key connected with your account)</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "963170": "You need to run kaggle datasets here on local notebook, print the variable it'll be something like this:\n\n`'gs://kds-xxxxxxxxxxxxxxxxxxxxxx'` x=some numbers\n\nCopy it and paste it on colab where you used `KaggleDatasets().get_gcs_path` on kaggle. Instead of loader command you have the GCS bucket address as string.",
    "963154": "To the best of my knowledge, you cannot install this module outside of Kaggle. So, the workaround is this: run `KaggleDatasets` on Kaggle to learn the GCS bucket addresses of the datasets of your interest and then use these addresses on Colab. You can store them in some kind of dictionary: `GCS['train']='...'`, `GCS['test']='...'`. Also, you will need to update these addresses periodically (once in 5-7 days) because they change.",
    "963054": "Does anyone know how can I install the kaggle\\_datasets module in the Google Colab? I faced this problem trying to run [this notebook](https://www.kaggle.com/cdeotte/triple-stratified-kfold-with-tfrecords) by @cdeotte in the Google Colab. There is just no such module in the colab environment. I've successfully installed the Kaggle module itself but I still can't use the kaggle_datasets module.\n\nHere is the import string of code which causes an error:\n`from kaggle_datasets import KaggleDatasets`\n",
    "963242": "Right, there is no official Kaggle support for this. Despite this, I have developed a solution that works for both Kaggle and Colab - described here: [here](https://www.kaggle.com/wrrosa/gcs-bucket-addresses-utility-package). (required kaggle API key connected with your account)"
  }
}