Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google colaboratory use kaggle, server version 1.5.6 , client version 1.5.4, failed to upgrade

I want to use the kaggle API in google colaboratory. The client installed is 1.5.4, the server is 1.5.6. After running install and upgrade kaggle via pip, the system still calls the version 1.5.4

I have tried installing and upgrading with pip the kaggle package. Doesn't work. I tried restarting the session/runtime as well.

!pip install kaggle/pip install kaggle --upgrade
Requirement already up-to-date: kaggle in /usr/local/lib/python3.6/dist-packages (1.5.6)
Requirement already satisfied, skipping upgrade: requests in /usr/local/lib/python3.6/dist-packages (from kaggle) (2.21.0)
Requirement already satisfied, skipping upgrade: certifi in /usr/local/lib/python3.6/dist-packages (from kaggle) (2019.9.11)
Requirement already satisfied, skipping upgrade: tqdm in /usr/local/lib/python3.6/dist-packages (from kaggle) (4.28.1)
Requirement already satisfied, skipping upgrade: python-dateutil in /usr/local/lib/python3.6/dist-packages (from kaggle) (2.6.1)
Requirement already satisfied, skipping upgrade: python-slugify in /usr/local/lib/python3.6/dist-packages (from kaggle) (4.0.0)
Requirement already satisfied, skipping upgrade: urllib3<1.25,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from kaggle) (1.24.3)
Requirement already satisfied, skipping upgrade: six>=1.10 in /usr/local/lib/python3.6/dist-packages (from kaggle) (1.12.0)
Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests->kaggle) (3.0.4)
Requirement already satisfied, skipping upgrade: idna<2.9,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests->kaggle) (2.8)
Requirement already satisfied, skipping upgrade: text-unidecode>=1.3 in /usr/local/lib/python3.6/dist-packages (from python-slugify->kaggle) (1.3)
!kaggle -v
Kaggle API 1.5.4
like image 287
bsaldivar Avatar asked Oct 31 '19 13:10

bsaldivar


1 Answers

Ah, this is indeed a strange state.

The fix: !pip install --upgrade --force-reinstall --no-deps kaggle

The underlying problem: we install both py2 and py3 packages, and (for historical reasons) the py2 packages are installed second. kaggle is a wrapper installed by the kaggle python package; since we do py2 second, the py2 wrapper is in /usr/local/bin, and happens to be an older version.

like image 194
Craig Citro Avatar answered Oct 13 '22 19:10

Craig Citro