11

I installed kaggle-cli just fine.. everything went smoothly or so pip says.

But when I try to run the kg command or just kg --version, I get

kg command not found

I can see Kaggle in Python system packages and all the py and pyc files are there. But like no bin directory or anything.

I tried to find a similar issue online with no success - so I thought I would try here.

I am on an Ubuntu app for Windows 10. Everything else in terms of Python, Keras, Theano, etc. for my machine learning rig works just fine.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
9_Dave_9
  • 694
  • 1
  • 7
  • 20

4 Answers4

32

Shortly after you asked this question, Kaggle released an official API which I recommend you use in place of kaggle-cli. pip install kaggle will install the official API which supports these commands:

kaggle competitions {list, files, download, submit, submissions}

kaggle datasets {list, files, download, create, version, init}

kaggle config {view, set, unset}

Check out the documentation here. After installing, you will also need to generate an API token from your Kaggle user profile "Account" tab.

Community
  • 1
  • 1
Meg Risdal
  • 1,017
  • 1
  • 11
  • 17
15

The same problem for me. Kaggle is correctly installed with pip install kaggle --user, but "kaggle command was not found".

I located the Kaggle executable in ~/.local/bin/kaggle and solved it creating a symbolic link to /usr/bin:

ln -s ~/.local/bin/kaggle /usr/bin/kaggle
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
gilgorio
  • 528
  • 6
  • 10
0

I was having the same issue on the GCP. What I did was to reinstall it again as with the

pip install kaggle --user

Then added the directory (shown in the warning after the installation) to the PATH Then I just reopened the remote access window.

Echo9k
  • 554
  • 6
  • 9
0

Installing the API using pip install kaggle might still not resolve the issue. You would have to add kaggle to PATH. Opening ~/.bashrc and adding alias kaggle="~/.local/bin/kaggle" to the end of the file worked for me.

sharmav
  • 11
  • 1