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.

4 Answers 4

32
+500

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.

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
2
  • Does not work for me, for some autorisation reason: even with sudo I have this message : ln: /usr/bin/kaggle: Operation not permitted
    – Fed Zee
    Feb 14, 2019 at 10:18
  • It partially worked for me. Not I get an error: Could not find kaggle.json. May 11, 2021 at 3:24
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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.