5nv
5nv

Reputation: 450

How to update python in Google Datalab (from google cloud platform)

How can I upgrade my python version in google datalab?

I tried already:

!pip install python --upgrade

And i get the response of "Requirement already up-to-date: python in /usr/lib/python2.7/lib-dynload", however if I type "!python2 --version" , I still get "Python 2.7.12"

Upvotes: 1

Views: 1497

Answers (2)

Jay
Jay

Reputation: 427

Please update datalab instance. You can use python3 in the new version.

https://cloud.google.com/datalab/docs/how-to/lifecycle#deleting_and_recreating_an_instance_without_deleting_the_notebooks_disk

Upvotes: 0

Chris Meyers
Chris Meyers

Reputation: 1426

You likely can't upgrade this using pip. You probably need to use apt-get, but I could be wrong here.

That said, Google Cloud Datalab currently uses an Ubuntu 16.04 (LTS) base image, and I think 2.7.12 might be the latest version that works with that OS. (Specifically it has 2.7.12-1ubuntu0~16.04.1, which is listed as the 16.04 version here: https://packages.ubuntu.com/search?keywords=python2.7)

Upvotes: 1

Related Questions