{
  "id": 133744,
  "title": "how to extract train.7z in kaggle noteook?",
  "url": "/competitions/malware-classification/discussion/133744",
  "author_name": "BHARATH S",
  "post_date": "2020-03-04T03:47:32.723000",
  "votes": 6,
  "comment_count": 22,
  "views": 0,
  "content": "<p>Hi\nwhat is the command to extract .7z files in kaggle notebook?\n I've found answers to extract .zip files but nothing for .7z file. </p>\n\n<p>Thanks</p>",
  "messages": [
    {
      "id": 1061884,
      "postDate": "2020-10-27T12:07:04.917Z",
      "content": "<p>You can extract by executing the command suggested by <a href=\"https://www.kaggle.com/mahmoudvaziri\" target=\"_blank\">@mahmoudvaziri</a>. But you need to execute these command before:</p>\n<pre><code>!apt-get install p7zip\n!apt-get install p7zip-full \n</code></pre>\n<p>And then <br>\n<code>!7za e 'file_name_XXX.7z;</code></p>",
      "rawMarkdown": "You can extract by executing the command suggested by @mahmoudvaziri. But you need to execute these command before:\n```\n!apt-get install p7zip\n!apt-get install p7zip-full \n```\nAnd then \n`!7za e 'file_name_XXX.7z;`",
      "votes": 7
    },
    {
      "id": 763035,
      "postDate": "2020-03-04T03:47:32.723Z",
      "content": "<p>Hi\nwhat is the command to extract .7z files in kaggle notebook?\n I've found answers to extract .zip files but nothing for .7z file. </p>\n\n<p>Thanks</p>",
      "rawMarkdown": "Hi\nwhat is the command to extract .7z files in kaggle notebook?\n I've found answers to extract .zip files but nothing for .7z file. \n\nThanks",
      "votes": 6
    },
    {
      "id": 763135,
      "postDate": "2020-03-04T07:09:09.220Z",
      "content": "<p>hi\n<code>!7za e XXX.7z</code></p>",
      "rawMarkdown": "hi\n`!7za e XXX.7z`",
      "votes": 2,
      "replies": [
        {
          "id": 763170,
          "postDate": "2020-03-04T07:56:30.383Z",
          "content": "<p>Thanks a lot. it worked.</p>",
          "rawMarkdown": "Thanks a lot. it worked."
        },
        {
          "id": 768873,
          "postDate": "2020-03-11T09:35:49.057Z",
          "content": "<p>Hey, after extracting a few files it shows some error. Maybe because of memory usage? Can someone tell me how to extract the full dataset?</p>",
          "rawMarkdown": "Hey, after extracting a few files it shows some error. Maybe because of memory usage? Can someone tell me how to extract the full dataset?\n"
        },
        {
          "id": 783562,
          "postDate": "2020-03-23T13:27:47.637Z",
          "content": "<p>please refer the attachment.</p>",
          "rawMarkdown": "please refer the attachment.\n",
          "votes": 1
        },
        {
          "id": 784727,
          "postDate": "2020-03-24T13:11:53.693Z",
          "content": "<p>I have applied the code <a href=\"/bharath150\">@bharath150</a> ,but there is an issue.Please notice.\nThank you.</p>",
          "rawMarkdown": "I have applied the code @bharath150 ,but there is an issue.Please notice.\nThank you."
        },
        {
          "id": 785048,
          "postDate": "2020-03-24T18:25:34.490Z",
          "content": "<p>instead of just train.7z you should give the complete path for that to work.  Also kaggle notebook has only 4.9 gb disk space. extracted train.7z size will be more than 100 gb. so the notebook will crash.</p>",
          "rawMarkdown": "instead of just train.7z you should give the complete path for that to work.  Also kaggle notebook has only 4.9 gb disk space. extracted train.7z size will be more than 100 gb. so the notebook will crash."
        },
        {
          "id": 785377,
          "postDate": "2020-03-25T02:27:44.570Z",
          "content": "<p>Any idea how to extract entire dataset? \nThankyou. </p>",
          "rawMarkdown": " Any idea how to extract entire dataset? \nThankyou. "
        },
        {
          "id": 785656,
          "postDate": "2020-03-25T08:35:43.857Z",
          "content": "<p>if your local machine has enough memory, you can do it locally. or you use google cloud's notebook.</p>",
          "rawMarkdown": "if your local machine has enough memory, you can do it locally. or you use google cloud's notebook.",
          "votes": 1
        },
        {
          "id": 785946,
          "postDate": "2020-03-25T14:29:03.630Z",
          "content": "<p>Thank you</p>",
          "rawMarkdown": "Thank you"
        }
      ]
    },
    {
      "id": 1727648,
      "postDate": "2022-03-18T06:30:36.117Z",
      "content": "<p>!pip install py7zr<br>\nimport py7zr</p>\n<p>archive=py7zr.SevenZipFile('../input/cifar-10/train.7z', mode='r')<br>\narchive.extractall(path=\"/kaggle/temp\")<br>\narchive.close()</p>\n<p>PS :  look out the path of extraction according to your requirement</p>",
      "rawMarkdown": "!pip install py7zr\nimport py7zr\n\narchive=py7zr.SevenZipFile('../input/cifar-10/train.7z', mode='r')\narchive.extractall(path=\"/kaggle/temp\")\narchive.close()\n\nPS :  look out the path of extraction according to your requirement"
    },
    {
      "id": 1556785,
      "postDate": "2021-10-25T06:26:45.837Z",
      "content": "<p>I can't solve the problem below.</p>\n<p>=============================================================================<br>\n!apt-get install p7zip<br>\n!apt-get install p7zip-full <br>\n=&gt;<br>\nE: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)<br>\nE: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?<br>\nE: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)<br>\nE: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?<br>\nadd Codeadd Markdown</p>\n<p>!7za e 'train.7z;<br>\n=&gt;<br>\n/bin/bash: -c: line 0: unexpected EOF while looking for matching `''<br>\n/bin/bash: -c: line 1: syntax error: unexpected end of file<br>\nadd Codeadd Markdown</p>\n<p>train.head()</p>\n<h2>=&gt;</h2>\n<p>NameError                                 Traceback (most recent call last)<br>\n/tmp/ipykernel_36/642956413.py in <br>\n----&gt; 1 train.head()</p>\n<h1>NameError: name 'train' is not defined</h1>",
      "rawMarkdown": "I can't solve the problem below.\n\n=============================================================================\n!apt-get install p7zip\n!apt-get install p7zip-full \n=>\nE: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)\nE: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?\nE: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)\nE: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?\nadd Codeadd Markdown\n\n!7za e 'train.7z;\n=>\n/bin/bash: -c: line 0: unexpected EOF while looking for matching `''\n/bin/bash: -c: line 1: syntax error: unexpected end of file\nadd Codeadd Markdown\n\ntrain.head()\n=>\n---------------------------------------------------------------------------\nNameError                                 Traceback (most recent call last)\n/tmp/ipykernel_36/642956413.py in <module>\n----> 1 train.head()\n\nNameError: name 'train' is not defined\n=============================================================================="
    },
    {
      "id": 1014744,
      "postDate": "2020-09-17T17:01:42.947Z",
      "content": "<p>\"7za: not found\" while trying to extract the zip file <a href=\"https://www.kaggle.com/mahmoudvaziri\" target=\"_blank\">@mahmoudvaziri</a> </p>",
      "rawMarkdown": "\"7za: not found\" while trying to extract the zip file @mahmoudvaziri \n",
      "replies": [
        {
          "id": 1015978,
          "postDate": "2020-09-18T15:18:05.963Z",
          "content": "<p>Hi<br>\nI couldn't find a solution!</p>",
          "rawMarkdown": "Hi\nI couldn't find a solution!",
          "votes": 1
        },
        {
          "id": 1017896,
          "postDate": "2020-09-19T10:22:56.763Z",
          "content": "<p>After hours of searching on google i found one thing that worked for me <br>\n\"py7zr\"</p>\n<p>!pip install py7zr<br>\n!python -m py7zr x train.7z</p>",
          "rawMarkdown": "After hours of searching on google i found one thing that worked for me \n\"py7zr\"\n\n!pip install py7zr\n!python -m py7zr x train.7z",
          "votes": 3
        }
      ]
    },
    {
      "id": 990473,
      "postDate": "2020-08-29T16:21:17.817Z",
      "content": "<p>/bin/sh: 1: 7za: not found</p>\n<p>not able to unzip 7z file</p>",
      "rawMarkdown": "/bin/sh: 1: 7za: not found\n\nnot able to unzip 7z file"
    },
    {
      "id": 931552,
      "postDate": "2020-07-16T09:05:29.963Z",
      "content": "<p><a href=\"/keerthicheepurupalli\">@keerthicheepurupalli</a>  How did u fix the isse? can u add here the command used.</p>",
      "rawMarkdown": "@keerthicheepurupalli  How did u fix the isse? can u add here the command used."
    },
    {
      "id": 783292,
      "postDate": "2020-03-23T06:46:37.847Z",
      "content": "<p>Hey Bharath S,\nhow did you extracted the above using !7za e XXX.7z \nI am facing error-\n**2% 374 - train/18eZt9qWksQhoY3K60aE.as <br>\nERROR: E_FAIL</p>\n\n<p>Archives with Errors: 1**</p>\n\n<p>Thank you</p>",
      "rawMarkdown": "Hey Bharath S,\nhow did you extracted the above using !7za e XXX.7z \nI am facing error-\n**2% 374 - train/18eZt9qWksQhoY3K60aE.as                                        \nERROR: E_FAIL\n\nArchives with Errors: 1**\n\nThank you",
      "replies": [
        {
          "id": 783567,
          "postDate": "2020-03-23T13:29:05.103Z",
          "content": "<p>please refer the above comment.</p>",
          "rawMarkdown": "please refer the above comment.",
          "votes": 2
        },
        {
          "id": 898846,
          "postDate": "2020-06-23T19:39:14.697Z",
          "content": "<p><a href=\"/keerthicheepurupalli\">@keerthicheepurupalli</a>  are you still facing this issue and not able to extract the data from .7zip ?</p>",
          "rawMarkdown": "@keerthicheepurupalli  are you still facing this issue and not able to extract the data from .7zip ?"
        },
        {
          "id": 899204,
          "postDate": "2020-06-24T04:46:34.003Z",
          "content": "<p>No issues <a href=\"/faizainewelectricity\">@faizainewelectricity</a> </p>",
          "rawMarkdown": "No issues @faizainewelectricity "
        }
      ]
    },
    {
      "id": 931551,
      "postDate": "2020-07-16T09:04:37.070Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 1061884,
      "author_name": "Sunil Kumar Gouda",
      "author_url": "",
      "post_date": "2020-10-27T12:07:04.917000",
      "content": "<p>You can extract by executing the command suggested by <a href=\"https://www.kaggle.com/mahmoudvaziri\" target=\"_blank\">@mahmoudvaziri</a>. But you need to execute these command before:</p>\n<pre><code>!apt-get install p7zip\n!apt-get install p7zip-full \n</code></pre>\n<p>And then <br>\n<code>!7za e 'file_name_XXX.7z;</code></p>",
      "votes": 7,
      "replies": []
    },
    {
      "id": 763135,
      "author_name": "mahmoudvaziri",
      "author_url": "",
      "post_date": "2020-03-04T07:09:09.220000",
      "content": "<p>hi\n<code>!7za e XXX.7z</code></p>",
      "votes": 2,
      "replies": [
        {
          "id": 763170,
          "author_name": "BHARATH S",
          "author_url": "",
          "post_date": "2020-03-04T07:56:30.383000",
          "content": "<p>Thanks a lot. it worked.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 768873,
          "author_name": "Shashank Madhusudhan",
          "author_url": "",
          "post_date": "2020-03-11T09:35:49.057000",
          "content": "<p>Hey, after extracting a few files it shows some error. Maybe because of memory usage? Can someone tell me how to extract the full dataset?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 783562,
          "author_name": "BHARATH S",
          "author_url": "",
          "post_date": "2020-03-23T13:27:47.637000",
          "content": "<p>please refer the attachment.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 784727,
          "author_name": "Keerthi Cheepurupalli",
          "author_url": "",
          "post_date": "2020-03-24T13:11:53.693000",
          "content": "<p>I have applied the code <a href=\"/bharath150\">@bharath150</a> ,but there is an issue.Please notice.\nThank you.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 785048,
          "author_name": "BHARATH S",
          "author_url": "",
          "post_date": "2020-03-24T18:25:34.490000",
          "content": "<p>instead of just train.7z you should give the complete path for that to work.  Also kaggle notebook has only 4.9 gb disk space. extracted train.7z size will be more than 100 gb. so the notebook will crash.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 785377,
          "author_name": "Keerthi Cheepurupalli",
          "author_url": "",
          "post_date": "2020-03-25T02:27:44.570000",
          "content": "<p>Any idea how to extract entire dataset? \nThankyou. </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 785656,
          "author_name": "BHARATH S",
          "author_url": "",
          "post_date": "2020-03-25T08:35:43.857000",
          "content": "<p>if your local machine has enough memory, you can do it locally. or you use google cloud's notebook.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 785946,
          "author_name": "Keerthi Cheepurupalli",
          "author_url": "",
          "post_date": "2020-03-25T14:29:03.630000",
          "content": "<p>Thank you</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1727648,
      "author_name": "Bimal Gajera",
      "author_url": "",
      "post_date": "2022-03-18T06:30:36.117000",
      "content": "<p>!pip install py7zr<br>\nimport py7zr</p>\n<p>archive=py7zr.SevenZipFile('../input/cifar-10/train.7z', mode='r')<br>\narchive.extractall(path=\"/kaggle/temp\")<br>\narchive.close()</p>\n<p>PS :  look out the path of extraction according to your requirement</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1556785,
      "author_name": "AIBeginer",
      "author_url": "",
      "post_date": "2021-10-25T06:26:45.837000",
      "content": "<p>I can't solve the problem below.</p>\n<p>=============================================================================<br>\n!apt-get install p7zip<br>\n!apt-get install p7zip-full <br>\n=&gt;<br>\nE: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)<br>\nE: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?<br>\nE: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)<br>\nE: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?<br>\nadd Codeadd Markdown</p>\n<p>!7za e 'train.7z;<br>\n=&gt;<br>\n/bin/bash: -c: line 0: unexpected EOF while looking for matching `''<br>\n/bin/bash: -c: line 1: syntax error: unexpected end of file<br>\nadd Codeadd Markdown</p>\n<p>train.head()</p>\n<h2>=&gt;</h2>\n<p>NameError                                 Traceback (most recent call last)<br>\n/tmp/ipykernel_36/642956413.py in <br>\n----&gt; 1 train.head()</p>\n<h1>NameError: name 'train' is not defined</h1>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1014744,
      "author_name": "Gokulakrishnan",
      "author_url": "",
      "post_date": "2020-09-17T17:01:42.947000",
      "content": "<p>\"7za: not found\" while trying to extract the zip file <a href=\"https://www.kaggle.com/mahmoudvaziri\" target=\"_blank\">@mahmoudvaziri</a> </p>",
      "votes": 0,
      "replies": [
        {
          "id": 1015978,
          "author_name": "mahmoudvaziri",
          "author_url": "",
          "post_date": "2020-09-18T15:18:05.963000",
          "content": "<p>Hi<br>\nI couldn't find a solution!</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1017896,
          "author_name": "Gokulakrishnan",
          "author_url": "",
          "post_date": "2020-09-19T10:22:56.763000",
          "content": "<p>After hours of searching on google i found one thing that worked for me <br>\n\"py7zr\"</p>\n<p>!pip install py7zr<br>\n!python -m py7zr x train.7z</p>",
          "votes": 3,
          "replies": []
        }
      ]
    },
    {
      "id": 990473,
      "author_name": "Ram Kumar",
      "author_url": "",
      "post_date": "2020-08-29T16:21:17.817000",
      "content": "<p>/bin/sh: 1: 7za: not found</p>\n<p>not able to unzip 7z file</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 931552,
      "author_name": "Yathindra K",
      "author_url": "",
      "post_date": "2020-07-16T09:05:29.963000",
      "content": "<p><a href=\"/keerthicheepurupalli\">@keerthicheepurupalli</a>  How did u fix the isse? can u add here the command used.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 783292,
      "author_name": "Keerthi Cheepurupalli",
      "author_url": "",
      "post_date": "2020-03-23T06:46:37.847000",
      "content": "<p>Hey Bharath S,\nhow did you extracted the above using !7za e XXX.7z \nI am facing error-\n**2% 374 - train/18eZt9qWksQhoY3K60aE.as <br>\nERROR: E_FAIL</p>\n\n<p>Archives with Errors: 1**</p>\n\n<p>Thank you</p>",
      "votes": 0,
      "replies": [
        {
          "id": 783567,
          "author_name": "BHARATH S",
          "author_url": "",
          "post_date": "2020-03-23T13:29:05.103000",
          "content": "<p>please refer the above comment.</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 898846,
          "author_name": "Faizahmed Momin",
          "author_url": "",
          "post_date": "2020-06-23T19:39:14.697000",
          "content": "<p><a href=\"/keerthicheepurupalli\">@keerthicheepurupalli</a>  are you still facing this issue and not able to extract the data from .7zip ?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 899204,
          "author_name": "Keerthi Cheepurupalli",
          "author_url": "",
          "post_date": "2020-06-24T04:46:34.003000",
          "content": "<p>No issues <a href=\"/faizainewelectricity\">@faizainewelectricity</a> </p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 931551,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-07-16T09:04:37.070000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1061884": "You can extract by executing the command suggested by @mahmoudvaziri. But you need to execute these command before:\n```\n!apt-get install p7zip\n!apt-get install p7zip-full \n```\nAnd then \n`!7za e 'file_name_XXX.7z;`",
    "763035": "Hi\nwhat is the command to extract .7z files in kaggle notebook?\n I've found answers to extract .zip files but nothing for .7z file. \n\nThanks",
    "763135": "hi\n`!7za e XXX.7z`",
    "1727648": "!pip install py7zr\nimport py7zr\n\narchive=py7zr.SevenZipFile('../input/cifar-10/train.7z', mode='r')\narchive.extractall(path=\"/kaggle/temp\")\narchive.close()\n\nPS :  look out the path of extraction according to your requirement",
    "1556785": "I can't solve the problem below.\n\n=============================================================================\n!apt-get install p7zip\n!apt-get install p7zip-full \n=>\nE: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)\nE: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?\nE: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)\nE: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?\nadd Codeadd Markdown\n\n!7za e 'train.7z;\n=>\n/bin/bash: -c: line 0: unexpected EOF while looking for matching `''\n/bin/bash: -c: line 1: syntax error: unexpected end of file\nadd Codeadd Markdown\n\ntrain.head()\n=>\n---------------------------------------------------------------------------\nNameError                                 Traceback (most recent call last)\n/tmp/ipykernel_36/642956413.py in <module>\n----> 1 train.head()\n\nNameError: name 'train' is not defined\n==============================================================================",
    "1014744": "\"7za: not found\" while trying to extract the zip file @mahmoudvaziri \n",
    "990473": "/bin/sh: 1: 7za: not found\n\nnot able to unzip 7z file",
    "931552": "@keerthicheepurupalli  How did u fix the isse? can u add here the command used.",
    "783292": "Hey Bharath S,\nhow did you extracted the above using !7za e XXX.7z \nI am facing error-\n**2% 374 - train/18eZt9qWksQhoY3K60aE.as                                        \nERROR: E_FAIL\n\nArchives with Errors: 1**\n\nThank you",
    "931551": ""
  }
}