0

The kaggle API documentation (https://github.com/Kaggle/kaggle-api) states that one needs python 3 installed to install kaggle. However, when installing kaggle with the command pip install --user kaggle, it downloads to the wrong folder /usr/local/lib/python2.7/site-packages os that when I run kaggle --version, I get the error kaggle: command not found. How can I install kaggle in my python 3 folder?

Ultimately, I'm trying to use the kaggle API by following the steps on their GitHub post (https://github.com/Kaggle/kaggle-api). They state that if I get the error kaggle: command not found, I need to ensure that my python binaries are on the right path. I'm not quite sure what this means, but its definitely what's contributing to my problem.

I've installed kaggle using pip install kaggle and pip install --user kaggle, but both install to the directory at /usr/local/lib/python2.7/site-packages.

When running kaggle --version, I got the command kaggle: command not found

Roshin Raphel
  • 2,612
  • 4
  • 22
  • 40
Diego Domenig
  • 397
  • 1
  • 3
  • 7
  • take a look here: https://stackoverflow.com/questions/2915471/install-a-python-package-into-a-different-directory-using-pip – PV8 Jun 26 '19 at 09:13

2 Answers2

0

If you do not want to play around with your system environment variables, then there is a simple workaround for that.

Open your python3 command line, then Use pip from your code to install the required package!

import pip

def install(package):
    if hasattr(pip, 'main'):
        pip.main(['install', package])
    else:
        pip._internal.main(['install', package])

# Example
if __name__ == '__main__':
    install('kaggle')
tsumit
  • 312
  • 2
  • 10
0

Either use pip3 install xxx or python3 -m pip install xxx.

chris
  • 4,840
  • 5
  • 35
  • 66