Install Python 3.8 kernel in Google Colaboratory

后端 未结 3 1068
清歌不尽
清歌不尽 2020-12-11 03:33

I try to install a new Python version (3.8) using conda.

!wget -O mini.sh https://repo.anaconda.com/miniconda/Miniconda3-py38_4.8.2-Linux-x86_64.sh
!chmod +x         


        
相关标签:
3条回答
  • 2020-12-11 03:50

    Update: Originally answered on 2020-30-29, but this answer is now outdated, see the answers above.

    Based on these previous answers*, it seems that Google only supports python 2.7 and python 3.6 right now (as of 2020-03-29). However, if you must use python 3.8 you could connect to a local runtime: https://research.google.com/colaboratory/local-runtimes.html

    *Previous answers:

    • Use latest Python version on Google Colab
    • How to force google colab to run in particular python version
    • Google Colab - Choosing specific Python version
    • Is there a way to use Python 3.5 instead of 3.6?
    • Python 3.5 in google colab
    0 讨论(0)
  • 2020-12-11 04:14

    I have found how to run Python 3.8 notebook on Colab.

    • install Anaconda3
    • add (fake) google.colab library
    • start jupyterlab
    • access it with ngrok

    Here's the code

    # install Anaconda3
    !wget -qO ac.sh https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh 
    !bash ./ac.sh -b
    
    # a fake google.colab library
    !ln -s /usr/local/lib/python3.6/dist-packages/google \
           /root/anaconda3/lib/python3.8/site-packages/google
    
    # start jupyterlab, which now has Python3 = 3.8
    !nohup /root/anaconda3/bin/jupyter-lab --ip=0.0.0.0&
    
    # access through ngrok, click the link
    !pip install pyngrok -q
    from pyngrok import ngrok
    print(ngrok.connect(8888))
    
    0 讨论(0)
  • 2020-12-11 04:16

    we can also use kora pip library

    !pip install kora
    import kora.install.py38
    
    0 讨论(0)
提交回复
热议问题