{
  "id": 114602,
  "title": "How should I install kaggle in GCP?",
  "url": "/competitions/rsna-intracranial-hemorrhage-detection/discussion/114602",
  "author_name": "Mighty Rains",
  "post_date": "2019-10-27T21:26:19.976000",
  "votes": 2,
  "comment_count": 3,
  "views": 0,
  "content": "<p>I am connected to the GCP and able to run the notebook.\nI tried to install kaggle by running <code>pip3 install --user kaggle</code> from putty (or wherever) and it installed successfully. I then copied the kaggle.json to <em>~/.kaggle/kaggle.json</em>.\nNow when I try to run kaggle from shell, it fails to find the executable. I tried all sorts of things, <code>pip show kaggle</code>, <code>whereis kaggle</code> and I even tried <code>accio kaggle</code>, but nothing worked. I tried logging out and coming back too. Didn't work.</p>\n\n<p>Interesting, if I do <code>import kaggle</code> from <code>python3</code>, it imports successfully.</p>\n\n<p>What should I do to be able to run kaggle from the shell?\nWhat I want to do is to download the data to GCP using kaggle API.</p>\n\n<p>I have shut down the GCP for now :D</p>\n\n<p>Edit:\nI did a <code>pip wheel kaggle</code> and the generated <code>.whl</code> file is just 2KB. Doesn't sound right to me?\nAnybody else faced something like this?</p>",
  "messages": [
    {
      "id": 659568,
      "postDate": "2019-10-27T23:00:02.377Z",
      "content": "<p>It works for me</p>\n\n<p><code>!mkdir -p ~/.kaggle</code>\n<code>!cp kaggle.json ~/.kaggle/</code>\n<code>!chmod 600 ~/.kaggle/kaggle.json</code>\n<code>!ls ~/.kaggle</code>\n<code>!pip3 install kaggle --user</code></p>\n\n<p>Instead of using \n<code>!kaggle</code></p>\n\n<p>Use this\n<code>!~/.local/bin/kaggle</code></p>",
      "rawMarkdown": "It works for me\n\n`!mkdir -p ~/.kaggle`\n`!cp kaggle.json ~/.kaggle/`\n`!chmod 600 ~/.kaggle/kaggle.json`\n`!ls ~/.kaggle`\n`!pip3 install kaggle --user`\n\nInstead of using \n`!kaggle`\n\nUse this\n`!~/.local/bin/kaggle`\n\n",
      "votes": 1
    },
    {
      "id": 659559,
      "postDate": "2019-10-27T22:22:51.420Z",
      "content": "<p>Alright, I compiled it from source using <code>python setup.py install</code> and it worked.</p>",
      "rawMarkdown": "Alright, I compiled it from source using `python setup.py install` and it worked.",
      "votes": 1
    },
    {
      "id": 659534,
      "postDate": "2019-10-27T21:26:19.977Z",
      "content": "<p>I am connected to the GCP and able to run the notebook.\nI tried to install kaggle by running <code>pip3 install --user kaggle</code> from putty (or wherever) and it installed successfully. I then copied the kaggle.json to <em>~/.kaggle/kaggle.json</em>.\nNow when I try to run kaggle from shell, it fails to find the executable. I tried all sorts of things, <code>pip show kaggle</code>, <code>whereis kaggle</code> and I even tried <code>accio kaggle</code>, but nothing worked. I tried logging out and coming back too. Didn't work.</p>\n\n<p>Interesting, if I do <code>import kaggle</code> from <code>python3</code>, it imports successfully.</p>\n\n<p>What should I do to be able to run kaggle from the shell?\nWhat I want to do is to download the data to GCP using kaggle API.</p>\n\n<p>I have shut down the GCP for now :D</p>\n\n<p>Edit:\nI did a <code>pip wheel kaggle</code> and the generated <code>.whl</code> file is just 2KB. Doesn't sound right to me?\nAnybody else faced something like this?</p>",
      "rawMarkdown": "I am connected to the GCP and able to run the notebook.\nI tried to install kaggle by running `pip3 install --user kaggle` from putty (or wherever) and it installed successfully. I then copied the kaggle.json to *~/.kaggle/kaggle.json*.\nNow when I try to run kaggle from shell, it fails to find the executable. I tried all sorts of things, `pip show kaggle`, `whereis kaggle` and I even tried `accio kaggle`, but nothing worked. I tried logging out and coming back too. Didn't work.\n\nInteresting, if I do `import kaggle` from `python3`, it imports successfully.\n\nWhat should I do to be able to run kaggle from the shell?\nWhat I want to do is to download the data to GCP using kaggle API.\n\nI have shut down the GCP for now :D\n\nEdit:\nI did a `pip wheel kaggle` and the generated `.whl` file is just 2KB. Doesn't sound right to me?\nAnybody else faced something like this?",
      "votes": 2
    },
    {
      "id": 659733,
      "postDate": "2019-10-28T07:39:52.960Z",
      "content": "<p>You just needed to run <code>PATH=$PATH:~/.local/bin</code>. I have reinstalled my system now, and got the same problem. It worked without it before, because I installed globally, but now they recommend to install on user. </p>",
      "rawMarkdown": "You just needed to run `PATH=$PATH:~/.local/bin`. I have reinstalled my system now, and got the same problem. It worked without it before, because I installed globally, but now they recommend to install on user. "
    }
  ],
  "comments": [
    {
      "id": 659568,
      "author_name": "Gabriel",
      "author_url": "",
      "post_date": "2019-10-27T23:00:02.377000",
      "content": "<p>It works for me</p>\n\n<p><code>!mkdir -p ~/.kaggle</code>\n<code>!cp kaggle.json ~/.kaggle/</code>\n<code>!chmod 600 ~/.kaggle/kaggle.json</code>\n<code>!ls ~/.kaggle</code>\n<code>!pip3 install kaggle --user</code></p>\n\n<p>Instead of using \n<code>!kaggle</code></p>\n\n<p>Use this\n<code>!~/.local/bin/kaggle</code></p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 659559,
      "author_name": "Mighty Rains",
      "author_url": "",
      "post_date": "2019-10-27T22:22:51.420000",
      "content": "<p>Alright, I compiled it from source using <code>python setup.py install</code> and it worked.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 659733,
      "author_name": "nosound",
      "author_url": "",
      "post_date": "2019-10-28T07:39:52.960000",
      "content": "<p>You just needed to run <code>PATH=$PATH:~/.local/bin</code>. I have reinstalled my system now, and got the same problem. It worked without it before, because I installed globally, but now they recommend to install on user. </p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "659568": "It works for me\n\n`!mkdir -p ~/.kaggle`\n`!cp kaggle.json ~/.kaggle/`\n`!chmod 600 ~/.kaggle/kaggle.json`\n`!ls ~/.kaggle`\n`!pip3 install kaggle --user`\n\nInstead of using \n`!kaggle`\n\nUse this\n`!~/.local/bin/kaggle`\n\n",
    "659559": "Alright, I compiled it from source using `python setup.py install` and it worked.",
    "659534": "I am connected to the GCP and able to run the notebook.\nI tried to install kaggle by running `pip3 install --user kaggle` from putty (or wherever) and it installed successfully. I then copied the kaggle.json to *~/.kaggle/kaggle.json*.\nNow when I try to run kaggle from shell, it fails to find the executable. I tried all sorts of things, `pip show kaggle`, `whereis kaggle` and I even tried `accio kaggle`, but nothing worked. I tried logging out and coming back too. Didn't work.\n\nInteresting, if I do `import kaggle` from `python3`, it imports successfully.\n\nWhat should I do to be able to run kaggle from the shell?\nWhat I want to do is to download the data to GCP using kaggle API.\n\nI have shut down the GCP for now :D\n\nEdit:\nI did a `pip wheel kaggle` and the generated `.whl` file is just 2KB. Doesn't sound right to me?\nAnybody else faced something like this?",
    "659733": "You just needed to run `PATH=$PATH:~/.local/bin`. I have reinstalled my system now, and got the same problem. It worked without it before, because I installed globally, but now they recommend to install on user. "
  }
}