{
  "id": 373345,
  "title": "\"Module Not Found\" Error. Need help!!",
  "url": "/competitions/rsna-breast-cancer-detection/discussion/373345",
  "author_name": "Ron John",
  "post_date": "2022-12-21T00:24:07.608000",
  "votes": 1,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Hi,<br>\nThis might be a rookie problem but I dont know how to solve it. I am trying to install few libraries for my code.<br>\nI have this particular line in my code to install it. <br>\n<strong>!pip install -U pylibjpeg pylibjpeg-openjpeg pylibjpeg-libjpeg pydicom python-gdcm</strong></p>\n<p>When I try to create a new version of my code, it fails with this \"Module Not Found\" error. These are the things I tried:</p>\n<ol>\n<li>Internet ON. I install the libraries and run the code.</li>\n<li>I save the version. Version gets created successfully.</li>\n<li>I take this new version and switch OFF Internet. I comment the pip statement. Then I run the code. The code works.</li>\n<li>I save this version with Internet OFF and commented pip statement. And I get the error Module not Found.</li>\n</ol>\n<p>It always errors at <strong>Import gdcm</strong> statement.<br>\nPlease let me know how to resolve this. How do I ensure that once I install a package, it stays installed for all the versions of the notebook with Internet off and also when I submit it for the competition.</p>",
  "messages": [
    {
      "id": 2071753,
      "postDate": "2022-12-21T10:49:43.113Z",
      "content": "<p>Hi,<br>\njust to clarify the already present answers, you can use an actual notebook's outputs as the input of another notebook. Since in this competition we are not allowed to use the internet, if you're willing to install those packages, you should:</p>\n<ol>\n<li>create another notebook in which you actually download the packages you need (i.e. <code>!pip download python-gdcm</code>);</li>\n<li>save and commit the notebook;</li>\n<li>search for this notebook inside the competition's notebook data and add it;</li>\n<li>install the now-offline packages (i.e. <code>!pip install /kaggle/inputs/&lt;notebookdataset&gt;/python-gdcm.ecc.ecc</code>)</li>\n</ol>\n<p>In this way you should be able to install your needed packages without worries!</p>\n<p>You might keep in mind that, when you are submitting, the code is execute from scratch, so there is no data left from when you were working.</p>\n<p>As I started this competition I faced many problems with the <code>pydicom</code>'s installation! For me this import worked:</p>\n<pre><code>try:\n    import pylibjpeg\nexcept:\n    !pip install -U /kaggle/input/rsna-bce-download-wheels/pylibjpeg-1.4.0-py3-none-any.whl -v --find-links frozen_packages --no-index\n    !pip install -U /kaggle/input/rsna-bce-download-wheels/python_gdcm-3.0.20-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -v --find-links frozen_packages --no-index\n</code></pre>\n<p>So this notebook (and pydicom version) needs only those two packages… Which you can find (and use, if you will) in <a href=\"https://www.kaggle.com/code/mawanda/rsna-bce-download-wheels\" target=\"_blank\">a dataset</a> I've already created for my own. :)</p>\n<p>Happy kaggling!</p>",
      "rawMarkdown": "Hi,\njust to clarify the already present answers, you can use an actual notebook's outputs as the input of another notebook. Since in this competition we are not allowed to use the internet, if you're willing to install those packages, you should:\n1. create another notebook in which you actually download the packages you need (i.e. `!pip download python-gdcm`);\n2. save and commit the notebook;\n3. search for this notebook inside the competition's notebook data and add it;\n4. install the now-offline packages (i.e. `!pip install /kaggle/inputs/<notebookdataset>/python-gdcm.ecc.ecc`)\n\nIn this way you should be able to install your needed packages without worries!\n\nYou might keep in mind that, when you are submitting, the code is execute from scratch, so there is no data left from when you were working.\n\nAs I started this competition I faced many problems with the `pydicom`'s installation! For me this import worked:\n```\ntry:\n    import pylibjpeg\nexcept:\n    !pip install -U /kaggle/input/rsna-bce-download-wheels/pylibjpeg-1.4.0-py3-none-any.whl -v --find-links frozen_packages --no-index\n    !pip install -U /kaggle/input/rsna-bce-download-wheels/python_gdcm-3.0.20-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -v --find-links frozen_packages --no-index\n```\nSo this notebook (and pydicom version) needs only those two packages... Which you can find (and use, if you will) in [a dataset](https://www.kaggle.com/code/mawanda/rsna-bce-download-wheels) I've already created for my own. :)\n\nHappy kaggling!",
      "votes": 4,
      "replies": [
        {
          "id": 2072183,
          "postDate": "2022-12-21T20:13:44.737Z",
          "content": "<p>Thank you. I was able to resolve the issue with gdcm following your code snippet.</p>",
          "rawMarkdown": "Thank you. I was able to resolve the issue with gdcm following your code snippet.",
          "votes": 1
        }
      ]
    },
    {
      "id": 2071362,
      "postDate": "2022-12-21T00:24:07.610Z",
      "content": "<p>Hi,<br>\nThis might be a rookie problem but I dont know how to solve it. I am trying to install few libraries for my code.<br>\nI have this particular line in my code to install it. <br>\n<strong>!pip install -U pylibjpeg pylibjpeg-openjpeg pylibjpeg-libjpeg pydicom python-gdcm</strong></p>\n<p>When I try to create a new version of my code, it fails with this \"Module Not Found\" error. These are the things I tried:</p>\n<ol>\n<li>Internet ON. I install the libraries and run the code.</li>\n<li>I save the version. Version gets created successfully.</li>\n<li>I take this new version and switch OFF Internet. I comment the pip statement. Then I run the code. The code works.</li>\n<li>I save this version with Internet OFF and commented pip statement. And I get the error Module not Found.</li>\n</ol>\n<p>It always errors at <strong>Import gdcm</strong> statement.<br>\nPlease let me know how to resolve this. How do I ensure that once I install a package, it stays installed for all the versions of the notebook with Internet off and also when I submit it for the competition.</p>",
      "rawMarkdown": "Hi,\nThis might be a rookie problem but I dont know how to solve it. I am trying to install few libraries for my code.\nI have this particular line in my code to install it. \n**!pip install -U pylibjpeg pylibjpeg-openjpeg pylibjpeg-libjpeg pydicom python-gdcm**\n\nWhen I try to create a new version of my code, it fails with this \"Module Not Found\" error. These are the things I tried:\n1. Internet ON. I install the libraries and run the code.\n2. I save the version. Version gets created successfully.\n3. I take this new version and switch OFF Internet. I comment the pip statement. Then I run the code. The code works.\n4. I save this version with Internet OFF and commented pip statement. And I get the error Module not Found.\n\nIt always errors at **Import gdcm** statement.\nPlease let me know how to resolve this. How do I ensure that once I install a package, it stays installed for all the versions of the notebook with Internet off and also when I submit it for the competition.",
      "votes": 1
    },
    {
      "id": 2071731,
      "postDate": "2022-12-21T10:11:42.830Z",
      "content": "<p>Hi !</p>\n<p>This is not how it works and this is why you are getting this error. The right way to do it is to download the packages you need (with pypi for exemple), add them to a personal dataset and then add this dataset to your notebook. You can then import the packages from the dataset with internet off. Here is a tutorial I found : <a href=\"https://www.kaggle.com/code/truthr/install-python-packages-without-internet-access\" target=\"_blank\">https://www.kaggle.com/code/truthr/install-python-packages-without-internet-access</a><br>\nAnd this is how to know which package version you need : <a href=\"https://www.kaggle.com/c/severstal-steel-defect-detection/discussion/109679\" target=\"_blank\">https://www.kaggle.com/c/severstal-steel-defect-detection/discussion/109679</a></p>\n<p>Hope it helps !</p>",
      "rawMarkdown": "Hi !\n\nThis is not how it works and this is why you are getting this error. The right way to do it is to download the packages you need (with pypi for exemple), add them to a personal dataset and then add this dataset to your notebook. You can then import the packages from the dataset with internet off. Here is a tutorial I found : https://www.kaggle.com/code/truthr/install-python-packages-without-internet-access\nAnd this is how to know which package version you need : https://www.kaggle.com/c/severstal-steel-defect-detection/discussion/109679\n\nHope it helps !",
      "votes": 2,
      "replies": [
        {
          "id": 2072184,
          "postDate": "2022-12-21T20:15:05.270Z",
          "content": "<p>Thank you. I learnt something new. I was able to add more libraries based on the comment and the links.</p>",
          "rawMarkdown": "Thank you. I learnt something new. I was able to add more libraries based on the comment and the links.",
          "votes": 1
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2071753,
      "author_name": "Giovanni Cavallin",
      "author_url": "",
      "post_date": "2022-12-21T10:49:43.113000",
      "content": "<p>Hi,<br>\njust to clarify the already present answers, you can use an actual notebook's outputs as the input of another notebook. Since in this competition we are not allowed to use the internet, if you're willing to install those packages, you should:</p>\n<ol>\n<li>create another notebook in which you actually download the packages you need (i.e. <code>!pip download python-gdcm</code>);</li>\n<li>save and commit the notebook;</li>\n<li>search for this notebook inside the competition's notebook data and add it;</li>\n<li>install the now-offline packages (i.e. <code>!pip install /kaggle/inputs/&lt;notebookdataset&gt;/python-gdcm.ecc.ecc</code>)</li>\n</ol>\n<p>In this way you should be able to install your needed packages without worries!</p>\n<p>You might keep in mind that, when you are submitting, the code is execute from scratch, so there is no data left from when you were working.</p>\n<p>As I started this competition I faced many problems with the <code>pydicom</code>'s installation! For me this import worked:</p>\n<pre><code>try:\n    import pylibjpeg\nexcept:\n    !pip install -U /kaggle/input/rsna-bce-download-wheels/pylibjpeg-1.4.0-py3-none-any.whl -v --find-links frozen_packages --no-index\n    !pip install -U /kaggle/input/rsna-bce-download-wheels/python_gdcm-3.0.20-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -v --find-links frozen_packages --no-index\n</code></pre>\n<p>So this notebook (and pydicom version) needs only those two packages… Which you can find (and use, if you will) in <a href=\"https://www.kaggle.com/code/mawanda/rsna-bce-download-wheels\" target=\"_blank\">a dataset</a> I've already created for my own. :)</p>\n<p>Happy kaggling!</p>",
      "votes": 4,
      "replies": [
        {
          "id": 2072183,
          "author_name": "Ron John",
          "author_url": "",
          "post_date": "2022-12-21T20:13:44.737000",
          "content": "<p>Thank you. I was able to resolve the issue with gdcm following your code snippet.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2071731,
      "author_name": "Natyu",
      "author_url": "",
      "post_date": "2022-12-21T10:11:42.830000",
      "content": "<p>Hi !</p>\n<p>This is not how it works and this is why you are getting this error. The right way to do it is to download the packages you need (with pypi for exemple), add them to a personal dataset and then add this dataset to your notebook. You can then import the packages from the dataset with internet off. Here is a tutorial I found : <a href=\"https://www.kaggle.com/code/truthr/install-python-packages-without-internet-access\" target=\"_blank\">https://www.kaggle.com/code/truthr/install-python-packages-without-internet-access</a><br>\nAnd this is how to know which package version you need : <a href=\"https://www.kaggle.com/c/severstal-steel-defect-detection/discussion/109679\" target=\"_blank\">https://www.kaggle.com/c/severstal-steel-defect-detection/discussion/109679</a></p>\n<p>Hope it helps !</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2072184,
          "author_name": "Ron John",
          "author_url": "",
          "post_date": "2022-12-21T20:15:05.270000",
          "content": "<p>Thank you. I learnt something new. I was able to add more libraries based on the comment and the links.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2071753": "Hi,\njust to clarify the already present answers, you can use an actual notebook's outputs as the input of another notebook. Since in this competition we are not allowed to use the internet, if you're willing to install those packages, you should:\n1. create another notebook in which you actually download the packages you need (i.e. `!pip download python-gdcm`);\n2. save and commit the notebook;\n3. search for this notebook inside the competition's notebook data and add it;\n4. install the now-offline packages (i.e. `!pip install /kaggle/inputs/<notebookdataset>/python-gdcm.ecc.ecc`)\n\nIn this way you should be able to install your needed packages without worries!\n\nYou might keep in mind that, when you are submitting, the code is execute from scratch, so there is no data left from when you were working.\n\nAs I started this competition I faced many problems with the `pydicom`'s installation! For me this import worked:\n```\ntry:\n    import pylibjpeg\nexcept:\n    !pip install -U /kaggle/input/rsna-bce-download-wheels/pylibjpeg-1.4.0-py3-none-any.whl -v --find-links frozen_packages --no-index\n    !pip install -U /kaggle/input/rsna-bce-download-wheels/python_gdcm-3.0.20-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -v --find-links frozen_packages --no-index\n```\nSo this notebook (and pydicom version) needs only those two packages... Which you can find (and use, if you will) in [a dataset](https://www.kaggle.com/code/mawanda/rsna-bce-download-wheels) I've already created for my own. :)\n\nHappy kaggling!",
    "2071362": "Hi,\nThis might be a rookie problem but I dont know how to solve it. I am trying to install few libraries for my code.\nI have this particular line in my code to install it. \n**!pip install -U pylibjpeg pylibjpeg-openjpeg pylibjpeg-libjpeg pydicom python-gdcm**\n\nWhen I try to create a new version of my code, it fails with this \"Module Not Found\" error. These are the things I tried:\n1. Internet ON. I install the libraries and run the code.\n2. I save the version. Version gets created successfully.\n3. I take this new version and switch OFF Internet. I comment the pip statement. Then I run the code. The code works.\n4. I save this version with Internet OFF and commented pip statement. And I get the error Module not Found.\n\nIt always errors at **Import gdcm** statement.\nPlease let me know how to resolve this. How do I ensure that once I install a package, it stays installed for all the versions of the notebook with Internet off and also when I submit it for the competition.",
    "2071731": "Hi !\n\nThis is not how it works and this is why you are getting this error. The right way to do it is to download the packages you need (with pypi for exemple), add them to a personal dataset and then add this dataset to your notebook. You can then import the packages from the dataset with internet off. Here is a tutorial I found : https://www.kaggle.com/code/truthr/install-python-packages-without-internet-access\nAnd this is how to know which package version you need : https://www.kaggle.com/c/severstal-steel-defect-detection/discussion/109679\n\nHope it helps !"
  }
}