{
  "id": 341412,
  "title": "Fixing Error: ... missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )",
  "url": "/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/341412",
  "author_name": "",
  "post_date": "2022-08-02T18:39:39.899474500Z",
  "votes": 37,
  "comment_count": 6,
  "views": 0,
  "content": "<p>Hi all!</p>\n<p>Apparently some of the .dcm files are different than others in terms of the <code>dcm.file_meta.TransferSyntaxUID</code> (<a href=\"https://github.com/pydicom/pydicom/issues/1061\" target=\"_blank\">more details here</a>) - in short, some of them are:</p>\n<pre><code>print(dcm.file_meta.TransferSyntaxUID)\n'1.2.840.10008.1.2.4.70'\n</code></pre>\n<p>when they should simply be: <code>'1.2.840.10008.1'</code></p>\n<p>I had no clue, so when I tried to retrieve the images from some .dcm files, this error was popping up:</p>\n<pre><code>RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )\n</code></pre>\n<p><img src=\"https://i.imgur.com/TXna0RW.png\"></p>\n<p>I fixed it by putting at <strong>the beginning of the notebook</strong> (be sure to do this BEFORE importing <code>pydicom</code>) the following:</p>\n<pre><code>! pip install python-gdcm\n! pip install pylibjpeg pylibjpeg-libjpeg pydicom\n</code></pre>\n<p>or</p>\n<pre><code>! pip install -qU \"python-gdcm\" pydicom pylibjpeg \"opencv-python-headless\"\n</code></pre>\n<p>Hope this helps! Cheers!</p>",
  "messages": [
    {
      "id": "1881761",
      "postDate": "08/02/2022 18:39:39",
      "content": "<p>Hi all!</p>\n<p>Apparently some of the .dcm files are different than others in terms of the <code>dcm.file_meta.TransferSyntaxUID</code> (<a href=\"https://github.com/pydicom/pydicom/issues/1061\" target=\"_blank\">more details here</a>) - in short, some of them are:</p>\n<pre><code>print(dcm.file_meta.TransferSyntaxUID)\n'1.2.840.10008.1.2.4.70'\n</code></pre>\n<p>when they should simply be: <code>'1.2.840.10008.1'</code></p>\n<p>I had no clue, so when I tried to retrieve the images from some .dcm files, this error was popping up:</p>\n<pre><code>RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )\n</code></pre>\n<p><img src=\"https://i.imgur.com/TXna0RW.png\"></p>\n<p>I fixed it by putting at <strong>the beginning of the notebook</strong> (be sure to do this BEFORE importing <code>pydicom</code>) the following:</p>\n<pre><code>! pip install python-gdcm\n! pip install pylibjpeg pylibjpeg-libjpeg pydicom\n</code></pre>\n<p>or</p>\n<pre><code>! pip install -qU \"python-gdcm\" pydicom pylibjpeg \"opencv-python-headless\"\n</code></pre>\n<p>Hope this helps! Cheers!</p>",
      "rawMarkdown": "Hi all!\n\nApparently some of the .dcm files are different than others in terms of the `dcm.file_meta.TransferSyntaxUID` ([more details here](https://github.com/pydicom/pydicom/issues/1061)) - in short, some of them are:\n\n```\nprint(dcm.file_meta.TransferSyntaxUID)\n'1.2.840.10008.1.2.4.70'\n```\n\nwhen they should simply be: `'1.2.840.10008.1'`\n\nI had no clue, so when I tried to retrieve the images from some .dcm files, this error was popping up:\n\n```\nRuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )\n```\n\n<img src=\"https://i.imgur.com/TXna0RW.png\">\n\nI fixed it by putting at **the beginning of the notebook** (be sure to do this BEFORE importing `pydicom`) the following:\n\n```\n! pip install python-gdcm\n! pip install pylibjpeg pylibjpeg-libjpeg pydicom\n```\n\nor\n\n```\n! pip install -qU \"python-gdcm\" pydicom pylibjpeg \"opencv-python-headless\"\n```\n\nHope this helps! Cheers!",
      "votes": null
    },
    {
      "id": "1885177",
      "postDate": "08/05/2022 01:25:06",
      "content": "<p>In the case where the Internet is available, the method mentioned above is valid. However, as this competition requires the Internet off, we have to do another method such as using pydicom-conda-helper established by <a href=\"https://www.kaggle.com/awsaf49\" target=\"_blank\">@awsaf49</a></p>",
      "rawMarkdown": "In the case where the Internet is available, the method mentioned above is valid. However, as this competition requires the Internet off, we have to do another method such as using pydicom-conda-helper established by @awsaf49",
      "votes": null
    },
    {
      "id": "1885519",
      "postDate": "08/05/2022 08:25:25",
      "content": "<p>Could you give me a link? I haven't seen that one ^^</p>",
      "rawMarkdown": "Could you give me a link? I haven't seen that one ^^",
      "votes": null
    },
    {
      "id": "1886507",
      "postDate": "08/05/2022 22:31:20",
      "content": "<p><a href=\"https://www.kaggle.com/andradaolteanu\" target=\"_blank\">@andradaolteanu</a> </p>\n<p>Sorry, here it is.<br>\n<a href=\"https://www.kaggle.com/code/awsaf49/pydicom-conda-helper\" target=\"_blank\">https://www.kaggle.com/code/awsaf49/pydicom-conda-helper</a> </p>",
      "rawMarkdown": "andradaolteanu \n\nSorry, here it is.\nhttps://www.kaggle.com/code/awsaf49/pydicom-conda-helper",
      "votes": null
    },
    {
      "id": "1887008",
      "postDate": "08/06/2022 11:14:39",
      "content": "<p>thankssss! 🙏</p>",
      "rawMarkdown": "thankssss! 🙏",
      "votes": null
    },
    {
      "id": "1912898",
      "postDate": "08/25/2022 03:05:20",
      "content": "<p>When following the <a href=\"url\" target=\"_blank\">https://www.kaggle.com/code/awsaf49/pydicom-conda-helper</a>, I get a bunch of PathNotFound Errors.  Did anyone else see this too?</p>\n<pre><code>`Downloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/gdcm-2.8.9-py37h500ead1_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/conda-4.10.1-py37h89c1867_0.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/certifi-2020.12.5-py37h89c1867_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/openssl-1.1.1k-h7f98852_0.tar.bz2`\n</code></pre>",
      "rawMarkdown": "When following the [https://www.kaggle.com/code/awsaf49/pydicom-conda-helper](url), I get a bunch of PathNotFound Errors.  Did anyone else see this too?\n\n```\n`Downloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/gdcm-2.8.9-py37h500ead1_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/conda-4.10.1-py37h89c1867_0.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/certifi-2020.12.5-py37h89c1867_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/openssl-1.1.1k-h7f98852_0.tar.bz2`\n```",
      "votes": null
    },
    {
      "id": "1918795",
      "postDate": "08/29/2022 21:03:16",
      "content": "<p>I used the 'Add Data' button to add the referenced notebook… </p>\n<p><a href=\"https://www.kaggle.com/code/awsaf49/pydicom-conda-helper\" target=\"_blank\">https://www.kaggle.com/code/awsaf49/pydicom-conda-helper</a></p>\n<p>to my notebook then added the following into a cell at the top of my notebook to copy the relevant bz2 files to my /kaggle/working directory…</p>\n<p>!cp ../input/pydicom-conda-helper/*.bz2 /kaggle/working</p>\n<p>I also had to modify the conda install commands as follows:</p>\n<p>!conda install --offline 'libjpeg-turbo-2.1.0-h7f98852_0.tar.bz2'  -y<br>\n!conda install --offline 'libgcc-ng-9.3.0-h2828fa1_19.tar.bz2' -y<br>\n!conda install --offline 'gdcm-2.8.9-py37h500ead1_1.tar.bz2' -y<br>\n!conda install --offline 'conda-4.10.1-py37h89c1867_0.tar.bz2' -c conda-forge -y<br>\n!conda install --offline 'certifi-2020.12.5-py37h89c1867_1.tar.bz2' -y<br>\n!conda install --offline 'openssl-1.1.1k-h7f98852_0.tar.bz2' -y</p>",
      "rawMarkdown": "I used the 'Add Data' button to add the referenced notebook... \n\nhttps://www.kaggle.com/code/awsaf49/pydicom-conda-helper\n\nto my notebook then added the following into a cell at the top of my notebook to copy the relevant bz2 files to my /kaggle/working directory...\n\n!cp ../input/pydicom-conda-helper/*.bz2 /kaggle/working\n\nI also had to modify the conda install commands as follows:\n\n!conda install --offline 'libjpeg-turbo-2.1.0-h7f98852_0.tar.bz2'  -y\n!conda install --offline 'libgcc-ng-9.3.0-h2828fa1_19.tar.bz2' -y\n!conda install --offline 'gdcm-2.8.9-py37h500ead1_1.tar.bz2' -y\n!conda install --offline 'conda-4.10.1-py37h89c1867_0.tar.bz2' -c conda-forge -y\n!conda install --offline 'certifi-2020.12.5-py37h89c1867_1.tar.bz2' -y\n!conda install --offline 'openssl-1.1.1k-h7f98852_0.tar.bz2' -y",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1885177,
      "author_name": "kosukekita",
      "author_url": "",
      "post_date": "08/05/2022 01:25:06",
      "content": "<p>In the case where the Internet is available, the method mentioned above is valid. However, as this competition requires the Internet off, we have to do another method such as using pydicom-conda-helper established by <a href=\"https://www.kaggle.com/awsaf49\" target=\"_blank\">@awsaf49</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 1885519,
          "author_name": "andradaolteanu",
          "author_url": "",
          "post_date": "08/05/2022 08:25:25",
          "content": "<p>Could you give me a link? I haven't seen that one ^^</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1886507,
      "author_name": "kosukekita",
      "author_url": "",
      "post_date": "08/05/2022 22:31:20",
      "content": "<p><a href=\"https://www.kaggle.com/andradaolteanu\" target=\"_blank\">@andradaolteanu</a> </p>\n<p>Sorry, here it is.<br>\n<a href=\"https://www.kaggle.com/code/awsaf49/pydicom-conda-helper\" target=\"_blank\">https://www.kaggle.com/code/awsaf49/pydicom-conda-helper</a> </p>",
      "votes": null,
      "replies": [
        {
          "id": 1887008,
          "author_name": "andradaolteanu",
          "author_url": "",
          "post_date": "08/06/2022 11:14:39",
          "content": "<p>thankssss! 🙏</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1912898,
      "author_name": "cbarb15",
      "author_url": "",
      "post_date": "08/25/2022 03:05:20",
      "content": "<p>When following the <a href=\"url\" target=\"_blank\">https://www.kaggle.com/code/awsaf49/pydicom-conda-helper</a>, I get a bunch of PathNotFound Errors.  Did anyone else see this too?</p>\n<pre><code>`Downloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/gdcm-2.8.9-py37h500ead1_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/conda-4.10.1-py37h89c1867_0.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/certifi-2020.12.5-py37h89c1867_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/openssl-1.1.1k-h7f98852_0.tar.bz2`\n</code></pre>",
      "votes": null,
      "replies": [
        {
          "id": 1918795,
          "author_name": "johnrobinsn",
          "author_url": "",
          "post_date": "08/29/2022 21:03:16",
          "content": "<p>I used the 'Add Data' button to add the referenced notebook… </p>\n<p><a href=\"https://www.kaggle.com/code/awsaf49/pydicom-conda-helper\" target=\"_blank\">https://www.kaggle.com/code/awsaf49/pydicom-conda-helper</a></p>\n<p>to my notebook then added the following into a cell at the top of my notebook to copy the relevant bz2 files to my /kaggle/working directory…</p>\n<p>!cp ../input/pydicom-conda-helper/*.bz2 /kaggle/working</p>\n<p>I also had to modify the conda install commands as follows:</p>\n<p>!conda install --offline 'libjpeg-turbo-2.1.0-h7f98852_0.tar.bz2'  -y<br>\n!conda install --offline 'libgcc-ng-9.3.0-h2828fa1_19.tar.bz2' -y<br>\n!conda install --offline 'gdcm-2.8.9-py37h500ead1_1.tar.bz2' -y<br>\n!conda install --offline 'conda-4.10.1-py37h89c1867_0.tar.bz2' -c conda-forge -y<br>\n!conda install --offline 'certifi-2020.12.5-py37h89c1867_1.tar.bz2' -y<br>\n!conda install --offline 'openssl-1.1.1k-h7f98852_0.tar.bz2' -y</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1881761": "Hi all!\n\nApparently some of the .dcm files are different than others in terms of the `dcm.file_meta.TransferSyntaxUID` ([more details here](https://github.com/pydicom/pydicom/issues/1061)) - in short, some of them are:\n\n```\nprint(dcm.file_meta.TransferSyntaxUID)\n'1.2.840.10008.1.2.4.70'\n```\n\nwhen they should simply be: `'1.2.840.10008.1'`\n\nI had no clue, so when I tried to retrieve the images from some .dcm files, this error was popping up:\n\n```\nRuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. GDCM), pylibjpeg (req. )\n```\n\n<img src=\"https://i.imgur.com/TXna0RW.png\">\n\nI fixed it by putting at **the beginning of the notebook** (be sure to do this BEFORE importing `pydicom`) the following:\n\n```\n! pip install python-gdcm\n! pip install pylibjpeg pylibjpeg-libjpeg pydicom\n```\n\nor\n\n```\n! pip install -qU \"python-gdcm\" pydicom pylibjpeg \"opencv-python-headless\"\n```\n\nHope this helps! Cheers!",
    "1885177": "In the case where the Internet is available, the method mentioned above is valid. However, as this competition requires the Internet off, we have to do another method such as using pydicom-conda-helper established by @awsaf49",
    "1885519": "Could you give me a link? I haven't seen that one ^^",
    "1886507": "andradaolteanu \n\nSorry, here it is.\nhttps://www.kaggle.com/code/awsaf49/pydicom-conda-helper",
    "1887008": "thankssss! 🙏",
    "1912898": "When following the [https://www.kaggle.com/code/awsaf49/pydicom-conda-helper](url), I get a bunch of PathNotFound Errors.  Did anyone else see this too?\n\n```\n`Downloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/gdcm-2.8.9-py37h500ead1_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/conda-4.10.1-py37h89c1867_0.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/certifi-2020.12.5-py37h89c1867_1.tar.bz2\n\n\nDownloading and Extracting Packages\n                                                                         |   0% \n\nPathNotFoundError: /kaggle/working/openssl-1.1.1k-h7f98852_0.tar.bz2`\n```",
    "1918795": "I used the 'Add Data' button to add the referenced notebook... \n\nhttps://www.kaggle.com/code/awsaf49/pydicom-conda-helper\n\nto my notebook then added the following into a cell at the top of my notebook to copy the relevant bz2 files to my /kaggle/working directory...\n\n!cp ../input/pydicom-conda-helper/*.bz2 /kaggle/working\n\nI also had to modify the conda install commands as follows:\n\n!conda install --offline 'libjpeg-turbo-2.1.0-h7f98852_0.tar.bz2'  -y\n!conda install --offline 'libgcc-ng-9.3.0-h2828fa1_19.tar.bz2' -y\n!conda install --offline 'gdcm-2.8.9-py37h500ead1_1.tar.bz2' -y\n!conda install --offline 'conda-4.10.1-py37h89c1867_0.tar.bz2' -c conda-forge -y\n!conda install --offline 'certifi-2020.12.5-py37h89c1867_1.tar.bz2' -y\n!conda install --offline 'openssl-1.1.1k-h7f98852_0.tar.bz2' -y"
  },
  "source": "meta"
}