-1

After installing kaggle, when I am passing kaggle command to command window it is throwing this error.

Successfully installed kaggle-1.4.6 You are using pip version 10.0.1, however version 18.0 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\Users\vkrnt>kaggle Traceback (most recent call last): File "c:\users\vkrnt\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:\users\vkrnt\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\vkrnt\Anaconda3\Scripts\kaggle.exe__main__.py", line 5, in File "c:\users\vkrnt\anaconda3\lib\site-packages\kaggle__init__.py", line 23, in api.authenticate() File "c:\users\vkrnt\anaconda3\lib\site-packages\kaggle\api\kaggle_api_extended.py", line 109, in authenticate self._load_config(config_data) File "c:\users\vkrnt\anaconda3\lib\site-packages\kaggle\api\kaggle_api_extended.py", line 151, in _load_config raise ValueError('Error: Missing %s in configuration.' % item) ValueError: Error: Missing username in configuration.

Not able to find solution for this. Please help me out here.

Thanks.

petezurich
  • 9,280
  • 9
  • 43
  • 57
  • I have added json file in .json folder as well.But still I am getting this error even when I am running any command.I went through kaggle_api_extended.py file and from first look it seems it has something to do with configuration file. – VIKRANT KUMAR SINGH Aug 19 '18 at 12:35

1 Answers1

1

I had the same problem although I used pipenv. To solve it I just followed the API credentials section of kaggle-api readme. Extract from the readme:

To use the Kaggle API, sign up for a Kaggle account at https://www.kaggle.com. Then go to the 'Account' tab of your user profile (https://www.kaggle.com//account) and select 'Create API Token'. This will trigger the download of kaggle.json, a file containing your API credentials. Place this file in the location ~/.kaggle/kaggle.json (on Windows in the location C:\Users\.kaggle\kaggle.json - you can check the exact location, sans drive, with echo %HOMEPATH%). You can define a shell environment variable KAGGLE_CONFIG_DIR to change this location to $KAGGLE_CONFIG_DIR/kaggle.json (on Windows it will be %KAGGLE_CONFIG_DIR%\kaggle.json