Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Python 3 Support #902

Closed
dsignr opened this issue Jul 8, 2016 · 22 comments
Closed

Python 3 Support #902

dsignr opened this issue Jul 8, 2016 · 22 comments

Comments

@dsignr
Copy link

dsignr commented Jul 8, 2016

Hi, is it possible currently to upgrade the version of Python used by Datalab? My default install uses 2.7.9, but would love to use 3.xx. Thoughts?

Thank you.

@VelizarVESSELINOV
Copy link

👍 Pandas often has issues with Python 2 version like pandas-dev/pandas#12142, and the management of string in Python 2 it is really a pain.

@dsignr
Copy link
Author

dsignr commented Jul 11, 2016

@VelizarVESSELINOV Agreed. I'd really LOVE to see a Py3 version 👍

@donaldbraman
Copy link

Yes, please.

@eyadsibai
Copy link

Is there any plans to support python3?

@yebrahim
Copy link
Contributor

I'm not sure we'll be able get to it soon unfortunately. PRs are more than welcome though, so please feel free to continue the discussion or send a change if you feel like it. :)

@nikhilk
Copy link
Contributor

nikhilk commented Nov 24, 2016

I think we need to actually think through a few things about how to provide this - one container per version, one version per kernel etc. and implications of those approaches.

@yebrahim
Copy link
Contributor

Ideally, the version should be tied to the notebook, so the user can choose what kernel to run when creating a new notebook. We should also find a way of making this visible inside the notebook somehow. I believe this is what Jupyter does too.

@donaldbraman
Copy link

donaldbraman commented Nov 24, 2016 via email

@chmeyers chmeyers changed the title Upgrade Python Version? Python 3 Support Mar 10, 2017
@chmeyers
Copy link
Contributor

This likely requires the equivalent pydatalab support: googledatalab/pydatalab#21

chmeyers added a commit that referenced this issue May 1, 2017
* Adding a Python 3 Kernel to Datalab.

Installs Python 3 and py3 versions of our supported packages,
including the python3 jupyter kernel, and adds a dropdown to
the notebook page to allow users to switch kernels.

Fixes #902

* Fix merge error.

* Changes based on review comments.

* Fixing minimum toolbar width.

* Fixing build error.
@donaldbraman
Copy link

Love it! Thank you so much @chmeyers!

@dsignr
Copy link
Author

dsignr commented May 2, 2017

Love it! Thanks so much guys :) 👍

@chmeyers
Copy link
Contributor

chmeyers commented May 2, 2017

Did some investigation with the first official build that has this.

Docker image (compressed on GCR) is 790MB vs 566 MB for the previous version. Expectation is that initial startup time for VMs is increased by ~15s due to the extra download time.

RAM usage didn't seem to change significantly, this and the previous version appeared to use within tens of MB of each other.

Still have to go through all the Sample Notebooks and libraries and check what doesn't work in Python 3. That will be tracked by googledatalab/pydatalab#21

@vochicong
Copy link
Contributor

Hi,

How can I start using the py3 version?
I've just followed the quickstarts
and found that only py2 kernel is available.

# jupyter kernelspec list                                                                
Available kernels:
  python2    /usr/local/lib/python2.7/dist-packages/ipykernel/resources

Thanks in advance!

@chmeyers
Copy link
Contributor

To use py3 currently, you'll need to grab a pre-release version of Datalab.

You can do this by specifying an image-name during creation: datalab create --image-name=gcr.io/cloud-datalab/datalab:commit-4bbc2c148c973fa433224d4821a9b2b4f5f28e34

@vochicong
Copy link
Contributor

I'm trying datalab create --image-name gcr.io/cloud-datalab/datalab:commit-latest-master-build, found py3 inside. It looks promissing 👍 Thank you @chmeyers !

@VelizarVESSELINOV
Copy link

When I'm using kernel Python3, my expectation was that pip and python commands are by default using the kernel version of Python 3 and not the Python 2. Do you agree with my expectations?

For migration of notebooks from 2to3 with commands inside it will be logical that basic command stays the same, and during the kernel switch, the aliases are directed to the current version.

@chmeyers
Copy link
Contributor

Both the py2 and py3 kernels run on the same underlying file system, so 'pip' and 'python' always point to either py2 or py3 without regard for which kernel is actually running at the moment.

I'm trying to think of a good way to avoid that (without using entirely separate file systems for the two kernels) but can't think of one.

@donaldbraman
Copy link

donaldbraman commented Aug 28, 2017 via email

@VelizarVESSELINOV
Copy link

@donaldbraman I agree there is no reason to start a new Python notebook using the old version 2. I hope default will be Py3. All the packages that I'm using are Py3 compatible: http://py3readiness.org
I used the switch between Py3 and Py2 to validate the results of existing code and library with the two versions as before I got a BrokenPipe exception in Py2 as it is still challenging to do all the time code compatible for both version, I hope Py2 will disappear soon.

@VelizarVESSELINOV
Copy link

@chmeyers If Py3 is the default will be good to have python/pipe command to be used for python3/pip3 and python2/pip2 to be kept for legacy code execution.

@nikhilk
Copy link
Contributor

nikhilk commented Aug 31, 2017

Generally agree that we should optimize for either Py2 or Py3 rather than both at the same time.

@VelizarVESSELINOV
Copy link

@nikhilk Py3 is the future, suggestion to start with the future rather than the past Py2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants