{
  "id": 357032,
  "title": "use pip install in submission",
  "url": "/competitions/mayo-clinic-strip-ai/discussion/357032",
  "author_name": "Pierre Tisseur",
  "post_date": "2022-10-03T04:00:15.447000",
  "votes": 6,
  "comment_count": 4,
  "views": 0,
  "content": "<p>It is my second code competition. I wonder if it is possible to pip install a library in code competition?</p>",
  "messages": [
    {
      "id": 1968809,
      "postDate": "2022-10-03T08:11:56.567Z",
      "content": "<p>Hi,</p>\n<p>You can install python module from wheel(whl) file without internet connection:</p>\n<ol>\n<li>In your notebook A, make sure internet connection is enabled and download a python module by <code>!pip download</code>.</li>\n<li>Click \"Save Version\" and select \"Save &amp; Run All\".</li>\n<li>In another notebook B, load the notebook A from \"Add Data\"  and install the python module by <code>!pip install /path/to/your/module/*.whl</code></li>\n</ol>\n<p>However, some modules maybe difficult to install due to their complex dependency.</p>\n<p>BTW, If you want to install pyvips, <a href=\"https://www.kaggle.com/analokamus\" target=\"_blank\">@analokamus</a> 's notebook seems helpful to me. You can use it via loading the notebook:<br>\n<a href=\"https://www.kaggle.com/code/analokamus/how-to-use-pyvips-offline\" target=\"_blank\">https://www.kaggle.com/code/analokamus/how-to-use-pyvips-offline</a></p>",
      "rawMarkdown": "Hi,\n\nYou can install python module from wheel(whl) file without internet connection:\n\n1. In your notebook A, make sure internet connection is enabled and download a python module by `!pip download`.\n2. Click \"Save Version\" and select \"Save & Run All\".\n3. In another notebook B, load the notebook A from \"Add Data\"  and install the python module by `!pip install /path/to/your/module/*.whl`\n\nHowever, some modules maybe difficult to install due to their complex dependency.\n\nBTW, If you want to install pyvips, @analokamus 's notebook seems helpful to me. You can use it via loading the notebook:\nhttps://www.kaggle.com/code/analokamus/how-to-use-pyvips-offline",
      "votes": 8,
      "replies": [
        {
          "id": 1973113,
          "postDate": "2022-10-05T13:32:16.320Z",
          "content": "<p>Thanks, I did not see this notebook.</p>",
          "rawMarkdown": "Thanks, I did not see this notebook.",
          "votes": 2
        },
        {
          "id": 2267537,
          "postDate": "2023-05-21T04:05:26.563Z",
          "content": "<p><code>!pip install /path/to/your/module/*.whl</code> is an extremely useful way! I highly recommend everyone to use this method. And I want to add one more thing. Before pip install the whl file, we should know how to convert a module into a whl file. Make sure you first have installed setuptools by <code>pip install setuptools</code>. And then you go to the module file that you downloaded to your local machine instead of kaggle directory, you use anaconda prompt to do <code>python setup.py bdist_wheel</code>. Then, it would create a folder called 'dist'. In this folder, you get your whl file of the module. Make sure the module has the setup.py in the directory.</p>",
          "rawMarkdown": "`!pip install /path/to/your/module/*.whl ` is an extremely useful way! I highly recommend everyone to use this method. And I want to add one more thing. Before pip install the whl file, we should know how to convert a module into a whl file. Make sure you first have installed setuptools by `pip install setuptools`. And then you go to the module file that you downloaded to your local machine instead of kaggle directory, you use anaconda prompt to do `python setup.py bdist_wheel`. Then, it would create a folder called 'dist'. In this folder, you get your whl file of the module. Make sure the module has the setup.py in the directory.",
          "votes": 10
        }
      ]
    },
    {
      "id": 1968316,
      "postDate": "2022-10-03T04:00:15.447Z",
      "content": "<p>It is my second code competition. I wonder if it is possible to pip install a library in code competition?</p>",
      "rawMarkdown": "It is my second code competition. I wonder if it is possible to pip install a library in code competition?",
      "votes": 6
    },
    {
      "id": 1968403,
      "postDate": "2022-10-03T04:36:42.353Z",
      "content": "<p><a href=\"https://www.kaggle.com/pierretisseur\" target=\"_blank\">@pierretisseur</a>  I guess you can , however it will increase the execution time and need to keep pip install statements</p>",
      "rawMarkdown": "@pierretisseur  I guess you can , however it will increase the execution time and need to keep pip install statements",
      "votes": 2
    }
  ],
  "comments": [
    {
      "id": 1968809,
      "author_name": "FX-6300",
      "author_url": "",
      "post_date": "2022-10-03T08:11:56.567000",
      "content": "<p>Hi,</p>\n<p>You can install python module from wheel(whl) file without internet connection:</p>\n<ol>\n<li>In your notebook A, make sure internet connection is enabled and download a python module by <code>!pip download</code>.</li>\n<li>Click \"Save Version\" and select \"Save &amp; Run All\".</li>\n<li>In another notebook B, load the notebook A from \"Add Data\"  and install the python module by <code>!pip install /path/to/your/module/*.whl</code></li>\n</ol>\n<p>However, some modules maybe difficult to install due to their complex dependency.</p>\n<p>BTW, If you want to install pyvips, <a href=\"https://www.kaggle.com/analokamus\" target=\"_blank\">@analokamus</a> 's notebook seems helpful to me. You can use it via loading the notebook:<br>\n<a href=\"https://www.kaggle.com/code/analokamus/how-to-use-pyvips-offline\" target=\"_blank\">https://www.kaggle.com/code/analokamus/how-to-use-pyvips-offline</a></p>",
      "votes": 8,
      "replies": [
        {
          "id": 1973113,
          "author_name": "Pierre Tisseur",
          "author_url": "",
          "post_date": "2022-10-05T13:32:16.320000",
          "content": "<p>Thanks, I did not see this notebook.</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 2267537,
          "author_name": "Yue Sun",
          "author_url": "",
          "post_date": "2023-05-21T04:05:26.563000",
          "content": "<p><code>!pip install /path/to/your/module/*.whl</code> is an extremely useful way! I highly recommend everyone to use this method. And I want to add one more thing. Before pip install the whl file, we should know how to convert a module into a whl file. Make sure you first have installed setuptools by <code>pip install setuptools</code>. And then you go to the module file that you downloaded to your local machine instead of kaggle directory, you use anaconda prompt to do <code>python setup.py bdist_wheel</code>. Then, it would create a folder called 'dist'. In this folder, you get your whl file of the module. Make sure the module has the setup.py in the directory.</p>",
          "votes": 10,
          "replies": []
        }
      ]
    },
    {
      "id": 1968403,
      "author_name": "Ab_Rafey",
      "author_url": "",
      "post_date": "2022-10-03T04:36:42.353000",
      "content": "<p><a href=\"https://www.kaggle.com/pierretisseur\" target=\"_blank\">@pierretisseur</a>  I guess you can , however it will increase the execution time and need to keep pip install statements</p>",
      "votes": 2,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1968809": "Hi,\n\nYou can install python module from wheel(whl) file without internet connection:\n\n1. In your notebook A, make sure internet connection is enabled and download a python module by `!pip download`.\n2. Click \"Save Version\" and select \"Save & Run All\".\n3. In another notebook B, load the notebook A from \"Add Data\"  and install the python module by `!pip install /path/to/your/module/*.whl`\n\nHowever, some modules maybe difficult to install due to their complex dependency.\n\nBTW, If you want to install pyvips, @analokamus 's notebook seems helpful to me. You can use it via loading the notebook:\nhttps://www.kaggle.com/code/analokamus/how-to-use-pyvips-offline",
    "1968316": "It is my second code competition. I wonder if it is possible to pip install a library in code competition?",
    "1968403": "@pierretisseur  I guess you can , however it will increase the execution time and need to keep pip install statements"
  }
}