How can I use Python 2 on google colab?

前端 未结 2 1388
名媛妹妹
名媛妹妹 2020-12-03 23:08

Can someone guide me how can I use the earlier version of python i.e version2.x?

Under change runtime option - I can see option for selecting hardware accelerator.

相关标签:
2条回答
  • 2020-12-03 23:41

    You can use one of these 2 shortcuts to create a Python 2 Colab.

    • bit.ly/colabpy2
    • colab.to/py2

    They will forward to this URL.

    https://colab.research.google.com/notebook#create=true&language=python2

    0 讨论(0)
  • 2020-12-04 00:05

    Python 2 reached its end of life on January 1, 2020, and is no longer supported by the Python developer community. Because of that, Colab is in the process of deprecating Python 2 runtimes; see https://research.google.com/colaboratory/faq.html#python-2-deprecation for details.

    Presently, there is no way to change to Python 2 via the Colab UI, but existing Python 2 notebooks will still connect to Python 2 for the time being. So, for example, if you open a notebook like this one: https://colab.research.google.com/gist/jakevdp/de56c474b41add4540deba2426534a49/empty-py2.ipynb and execute code, it will execute in Python 2 for now. I would suggest following that link, and then choosing File->Save A Copy In Drive to get your own copy of an empty Python 2 notebook.

    But please be aware that at some point in the future, Python 2 runtimes will be entirely unavailable in Colab, even for existing notebooks that specify Python 2 in their metadata.

    0 讨论(0)
提交回复
热议问题