doufuxing8562 2019-01-20 13:40
浏览 251
已采纳

如何在Google Colaboratory中运行Golang

Now Google Colaboratory supports Python2 and Python3 kernels. Can I add a Golang kernel so that I can use Golang in Colab too?

I found a few examples here, but it only has JavaScript and R, no Golang.

  • 写回答

1条回答 默认 最新

  • dougongyou7364 2019-01-20 13:40
    关注

    First, you need to install the Golang kernel (gophernotes) from a normal Python notebook.

    !apt install golang-go libzmq3-dev
    %env GOPATH=/root/go
    !go get -u github.com/gopherdata/gophernotes
    !cp ~/go/bin/gophernotes /usr/bin/
    !mkdir /usr/local/share/jupyter/kernels/gophernotes
    !cp ~/go/src/github.com/gopherdata/gophernotes/kernel/* \
           /usr/local/share/jupyter/kernels/gophernotes
    

    Then make a copy of this go_1+1.ipynb notebook and run it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?