{
  "id": 519401,
  "title": "Internet off and pip install",
  "url": "/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/519401",
  "author_name": "",
  "post_date": "2024-07-11T00:34:05.418047600Z",
  "votes": 3,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Hi, I have a question regarding the Internet off rule.</p>\n<p>So I trained a few models, and I want to make a submission. The thing is, the models were trained using a library installed with pip. I need to install this library in the submission notebook but I can't, is there a workaround for this?</p>",
  "messages": [
    {
      "id": "2916373",
      "postDate": "07/11/2024 00:34:05",
      "content": "<p>Hi, I have a question regarding the Internet off rule.</p>\n<p>So I trained a few models, and I want to make a submission. The thing is, the models were trained using a library installed with pip. I need to install this library in the submission notebook but I can't, is there a workaround for this?</p>",
      "rawMarkdown": "Hi, I have a question regarding the Internet off rule.\n\nSo I trained a few models, and I want to make a submission. The thing is, the models were trained using a library installed with pip. I need to install this library in the submission notebook but I can't, is there a workaround for this?",
      "votes": null
    },
    {
      "id": "2916415",
      "postDate": "07/11/2024 02:29:45",
      "content": "<p>Hi, you can prepack everything in then dataset and the call sys.path.append or running the wheels.</p>",
      "rawMarkdown": "Hi, you can prepack everything in then dataset and the call sys.path.append or running the wheels.",
      "votes": null
    },
    {
      "id": "2917141",
      "postDate": "07/11/2024 14:01:32",
      "content": "<p>Here is how I save wheels for offline use:</p>\n<ol>\n<li>When you <code>%pip install &lt;your package names&gt;</code>, note the <strong>actual</strong> packages installed (which includes dependencies) by this command: Example: <code>acvl-utils-0.2 argparse-1.4.0 ...</code></li>\n<li>Copy all these, convert <code>-</code> to <code>==</code> and create wheels of these packages without any extra dependencies with <code>%pip wheel --no-deps</code>. Example: <code>%pip wheel --no-deps acvl-utils==0.2 argparse==1.4.0 ...</code></li>\n<li>Save these wheels as a Kaggle dataset and in your inference notebook install them with the path of the dataset: <code>%pip -q install --no-deps /kaggle/input/&lt;your saved dataset name&gt;/*.whl</code></li>\n</ol>\n<p><em>Note:</em> In step 3, <code>--no-deps</code> is optional and speeds-up installation of packages at the cost of not having dependency checks.</p>",
      "rawMarkdown": "Here is how I save wheels for offline use:\n1. When you `%pip install <your package names>`, note the **actual** packages installed (which includes dependencies) by this command: Example: `acvl-utils-0.2 argparse-1.4.0 ...`\n1. Copy all these, convert `-` to `==` and create wheels of these packages without any extra dependencies with `%pip wheel --no-deps`. Example: `%pip wheel --no-deps acvl-utils==0.2 argparse==1.4.0 ...`\n1. Save these wheels as a Kaggle dataset and in your inference notebook install them with the path of the dataset: `%pip -q install --no-deps /kaggle/input/<your saved dataset name>/*.whl`\n\n*Note:* In step 3, `--no-deps` is optional and speeds-up installation of packages at the cost of not having dependency checks.",
      "votes": null
    },
    {
      "id": "2917285",
      "postDate": "07/11/2024 15:15:42",
      "content": "<p>Will try these steps, thank you very much!</p>",
      "rawMarkdown": "Will try these steps, thank you very much!",
      "votes": null
    },
    {
      "id": "2917825",
      "postDate": "07/11/2024 20:10:01",
      "content": "<p>Confirmed!!! It is working, thank you again for the detailed answer!</p>",
      "rawMarkdown": "Confirmed!!! It is working, thank you again for the detailed answer!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2916415,
      "author_name": "sergiosaharovskiy",
      "author_url": "",
      "post_date": "07/11/2024 02:29:45",
      "content": "<p>Hi, you can prepack everything in then dataset and the call sys.path.append or running the wheels.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2917141,
      "author_name": "coderrkj",
      "author_url": "",
      "post_date": "07/11/2024 14:01:32",
      "content": "<p>Here is how I save wheels for offline use:</p>\n<ol>\n<li>When you <code>%pip install &lt;your package names&gt;</code>, note the <strong>actual</strong> packages installed (which includes dependencies) by this command: Example: <code>acvl-utils-0.2 argparse-1.4.0 ...</code></li>\n<li>Copy all these, convert <code>-</code> to <code>==</code> and create wheels of these packages without any extra dependencies with <code>%pip wheel --no-deps</code>. Example: <code>%pip wheel --no-deps acvl-utils==0.2 argparse==1.4.0 ...</code></li>\n<li>Save these wheels as a Kaggle dataset and in your inference notebook install them with the path of the dataset: <code>%pip -q install --no-deps /kaggle/input/&lt;your saved dataset name&gt;/*.whl</code></li>\n</ol>\n<p><em>Note:</em> In step 3, <code>--no-deps</code> is optional and speeds-up installation of packages at the cost of not having dependency checks.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2917285,
          "author_name": "lastmarchoftheents",
          "author_url": "",
          "post_date": "07/11/2024 15:15:42",
          "content": "<p>Will try these steps, thank you very much!</p>",
          "votes": null,
          "replies": [
            {
              "id": 2917825,
              "author_name": "lastmarchoftheents",
              "author_url": "",
              "post_date": "07/11/2024 20:10:01",
              "content": "<p>Confirmed!!! It is working, thank you again for the detailed answer!</p>",
              "votes": null,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2916373": "Hi, I have a question regarding the Internet off rule.\n\nSo I trained a few models, and I want to make a submission. The thing is, the models were trained using a library installed with pip. I need to install this library in the submission notebook but I can't, is there a workaround for this?",
    "2916415": "Hi, you can prepack everything in then dataset and the call sys.path.append or running the wheels.",
    "2917141": "Here is how I save wheels for offline use:\n1. When you `%pip install <your package names>`, note the **actual** packages installed (which includes dependencies) by this command: Example: `acvl-utils-0.2 argparse-1.4.0 ...`\n1. Copy all these, convert `-` to `==` and create wheels of these packages without any extra dependencies with `%pip wheel --no-deps`. Example: `%pip wheel --no-deps acvl-utils==0.2 argparse==1.4.0 ...`\n1. Save these wheels as a Kaggle dataset and in your inference notebook install them with the path of the dataset: `%pip -q install --no-deps /kaggle/input/<your saved dataset name>/*.whl`\n\n*Note:* In step 3, `--no-deps` is optional and speeds-up installation of packages at the cost of not having dependency checks.",
    "2917285": "Will try these steps, thank you very much!",
    "2917825": "Confirmed!!! It is working, thank you again for the detailed answer!"
  },
  "source": "meta"
}