{
  "id": 337173,
  "title": "How to install libraries without internet",
  "url": "/competitions/mayo-clinic-strip-ai/discussion/337173",
  "author_name": "moth",
  "post_date": "2022-07-14T20:14:37.407000",
  "votes": 7,
  "comment_count": 7,
  "views": 0,
  "content": "<p>This competition is a <strong>No internet</strong> competition. This means that when you are uploading a submission your notebook will not be able to access the internet.</p>\n<p>This may be an issue for you if you need to access the internet, for example, if you need to <strong>download a GitHub repo to use as a library.</strong></p>\n<p>How can we overcome this?</p>\n<p>Easy, download the repo as a zip file and upload it as a dataset. </p>\n<p>For example, I needed to use this <a href=\"https://github.com/lukemelas/EfficientNet-PyTorch\" target=\"_blank\">EfficientNet PyTorch repo</a>, so I could not download it at inference time. Just upload it as a dataset and run:</p>\n<pre><code>import sys \n\nsys.path.append(\"../input/efficientnet-pytorch/EfficientNet-PyTorch-master\") \n\nimport efficientnet_pytorch\n</code></pre>\n<p>Voilà, you have imported a GitHub repo without internet!</p>",
  "messages": [
    {
      "id": 1855706,
      "postDate": "2022-07-14T20:14:37.407Z",
      "content": "<p>This competition is a <strong>No internet</strong> competition. This means that when you are uploading a submission your notebook will not be able to access the internet.</p>\n<p>This may be an issue for you if you need to access the internet, for example, if you need to <strong>download a GitHub repo to use as a library.</strong></p>\n<p>How can we overcome this?</p>\n<p>Easy, download the repo as a zip file and upload it as a dataset. </p>\n<p>For example, I needed to use this <a href=\"https://github.com/lukemelas/EfficientNet-PyTorch\" target=\"_blank\">EfficientNet PyTorch repo</a>, so I could not download it at inference time. Just upload it as a dataset and run:</p>\n<pre><code>import sys \n\nsys.path.append(\"../input/efficientnet-pytorch/EfficientNet-PyTorch-master\") \n\nimport efficientnet_pytorch\n</code></pre>\n<p>Voilà, you have imported a GitHub repo without internet!</p>",
      "rawMarkdown": "This competition is a **No internet** competition. This means that when you are uploading a submission your notebook will not be able to access the internet.\n\nThis may be an issue for you if you need to access the internet, for example, if you need to **download a GitHub repo to use as a library.**\n\nHow can we overcome this?\n\nEasy, download the repo as a zip file and upload it as a dataset. \n\nFor example, I needed to use this [EfficientNet PyTorch repo](https://github.com/lukemelas/EfficientNet-PyTorch), so I could not download it at inference time. Just upload it as a dataset and run:\n\n```\nimport sys \n\nsys.path.append(\"../input/efficientnet-pytorch/EfficientNet-PyTorch-master\") \n\nimport efficientnet_pytorch\n```\n\nVoilà, you have imported a GitHub repo without internet!",
      "votes": 6
    },
    {
      "id": 1859203,
      "postDate": "2022-07-17T13:27:42.050Z",
      "content": "<p>I made a notebook to show how to install packages offline. Check it out! <a href=\"https://www.kaggle.com/code/analokamus/how-to-use-pyvips-offline/notebook\" target=\"_blank\">https://www.kaggle.com/code/analokamus/how-to-use-pyvips-offline/notebook</a></p>",
      "rawMarkdown": "I made a notebook to show how to install packages offline. Check it out! https://www.kaggle.com/code/analokamus/how-to-use-pyvips-offline/notebook",
      "votes": 1
    },
    {
      "id": 1857479,
      "postDate": "2022-07-16T06:33:06.487Z",
      "content": "<p>Good idea, this could be useful to many of us while submitting our work!</p>",
      "rawMarkdown": "Good idea, this could be useful to many of us while submitting our work!",
      "votes": 1,
      "replies": [
        {
          "id": 1858113,
          "postDate": "2022-07-16T17:09:37.797Z",
          "content": "<p>Indeed Ravi. At inference time we cannot access internet and if you rely on libraries and packages that do not come built in the notebook you need this approach.</p>",
          "rawMarkdown": "Indeed Ravi. At inference time we cannot access internet and if you rely on libraries and packages that do not come built in the notebook you need this approach."
        }
      ]
    },
    {
      "id": 1868040,
      "postDate": "2022-07-23T16:36:30.193Z",
      "content": "<p>I wrote a blog about it how you can use one notebook as a dataset for another kernel that is running offline:<br>\n<a href=\"https://towardsdatascience.com/easy-kaggle-offline-submission-with-chaining-kernels-30bba5ea5c4d\" target=\"_blank\">https://towardsdatascience.com/easy-kaggle-offline-submission-with-chaining-kernels-30bba5ea5c4d</a></p>",
      "rawMarkdown": "I wrote a blog about it how you can use one notebook as a dataset for another kernel that is running offline:\nhttps://towardsdatascience.com/easy-kaggle-offline-submission-with-chaining-kernels-30bba5ea5c4d",
      "votes": 2,
      "replies": [
        {
          "id": 1879346,
          "postDate": "2022-08-01T03:11:06.283Z",
          "content": "<p>Thanks for the great help Jirka, love your work :)</p>",
          "rawMarkdown": "Thanks for the great help Jirka, love your work :)"
        }
      ]
    },
    {
      "id": 1858308,
      "postDate": "2022-07-16T19:50:45.883Z",
      "content": "<p>This is a great tip! I had the same issue with trying to load some pretrained weights. I ended up just downloading the files and compressing them as ZIP file, uploading it to my Kaggle account, and then importing it like you said. Worked like a charm!</p>",
      "rawMarkdown": "This is a great tip! I had the same issue with trying to load some pretrained weights. I ended up just downloading the files and compressing them as ZIP file, uploading it to my Kaggle account, and then importing it like you said. Worked like a charm!\n"
    },
    {
      "id": 1872152,
      "postDate": "2022-07-26T17:45:10.340Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 1859203,
      "author_name": "RabotniKuma",
      "author_url": "",
      "post_date": "2022-07-17T13:27:42.050000",
      "content": "<p>I made a notebook to show how to install packages offline. Check it out! <a href=\"https://www.kaggle.com/code/analokamus/how-to-use-pyvips-offline/notebook\" target=\"_blank\">https://www.kaggle.com/code/analokamus/how-to-use-pyvips-offline/notebook</a></p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1857479,
      "author_name": "Ravi Ramakrishnan",
      "author_url": "",
      "post_date": "2022-07-16T06:33:06.487000",
      "content": "<p>Good idea, this could be useful to many of us while submitting our work!</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1858113,
          "author_name": "moth",
          "author_url": "",
          "post_date": "2022-07-16T17:09:37.797000",
          "content": "<p>Indeed Ravi. At inference time we cannot access internet and if you rely on libraries and packages that do not come built in the notebook you need this approach.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1868040,
      "author_name": "Jirka",
      "author_url": "",
      "post_date": "2022-07-23T16:36:30.193000",
      "content": "<p>I wrote a blog about it how you can use one notebook as a dataset for another kernel that is running offline:<br>\n<a href=\"https://towardsdatascience.com/easy-kaggle-offline-submission-with-chaining-kernels-30bba5ea5c4d\" target=\"_blank\">https://towardsdatascience.com/easy-kaggle-offline-submission-with-chaining-kernels-30bba5ea5c4d</a></p>",
      "votes": 2,
      "replies": [
        {
          "id": 1879346,
          "author_name": "Minhajul Hoque",
          "author_url": "",
          "post_date": "2022-08-01T03:11:06.283000",
          "content": "<p>Thanks for the great help Jirka, love your work :)</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1858308,
      "author_name": "The Devastator",
      "author_url": "",
      "post_date": "2022-07-16T19:50:45.883000",
      "content": "<p>This is a great tip! I had the same issue with trying to load some pretrained weights. I ended up just downloading the files and compressing them as ZIP file, uploading it to my Kaggle account, and then importing it like you said. Worked like a charm!</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1872152,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-07-26T17:45:10.340000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1855706": "This competition is a **No internet** competition. This means that when you are uploading a submission your notebook will not be able to access the internet.\n\nThis may be an issue for you if you need to access the internet, for example, if you need to **download a GitHub repo to use as a library.**\n\nHow can we overcome this?\n\nEasy, download the repo as a zip file and upload it as a dataset. \n\nFor example, I needed to use this [EfficientNet PyTorch repo](https://github.com/lukemelas/EfficientNet-PyTorch), so I could not download it at inference time. Just upload it as a dataset and run:\n\n```\nimport sys \n\nsys.path.append(\"../input/efficientnet-pytorch/EfficientNet-PyTorch-master\") \n\nimport efficientnet_pytorch\n```\n\nVoilà, you have imported a GitHub repo without internet!",
    "1859203": "I made a notebook to show how to install packages offline. Check it out! https://www.kaggle.com/code/analokamus/how-to-use-pyvips-offline/notebook",
    "1857479": "Good idea, this could be useful to many of us while submitting our work!",
    "1868040": "I wrote a blog about it how you can use one notebook as a dataset for another kernel that is running offline:\nhttps://towardsdatascience.com/easy-kaggle-offline-submission-with-chaining-kernels-30bba5ea5c4d",
    "1858308": "This is a great tip! I had the same issue with trying to load some pretrained weights. I ended up just downloading the files and compressing them as ZIP file, uploading it to my Kaggle account, and then importing it like you said. Worked like a charm!\n",
    "1872152": ""
  }
}