jupyter notebook下安装go内核的一些坑

最近在学go,想在jupyter notebook下敲下go,于是google,有教程,
https://github.com/gopherdata…
开始搬砖。。。。

$ go get -u github.com/gopherdata/gophernotes
$ mkdir -p ~/.local/share/jupyter/kernels/gophernotes
$ cp $GOPATH/src/github.com/gopherdata/gophernotes/kernel/* ~/.local/share/jupyter/kernels/gophernotes

安装起来还是很简单的,但是还是有一些坑。
《jupyter notebook下安装go内核的一些坑》
1.go安装好,把GOPATH/bin的目录加入到PATH中。
2.jupyter notebook按教程安装好。
3.zernmQ 去官网安装 http://zeromq.org/intro:get-the-software
4.pkg-config 一般linux自带 ,我的机器有就没装

坑:
装好了后运行以下 pkg-config –cflags libzmq,如果有以下错误
《jupyter notebook下安装go内核的一些坑》

用命令 find / -maxdepth 6 -name libzmq.pc 找到文件
在把文件的目录写入~/.bash_profile,我的如下
《jupyter notebook下安装go内核的一些坑》
然后source ~/.bash_profile生效以下就好了,再次运行pkg-config –cflags libzmq就成功了
《jupyter notebook下安装go内核的一些坑》

运行gophernotes的时候会出现 error while loading shared libraries:libzmq.so.5的错误,懵了,搞不懂,网上找找答案,https://www.cnblogs.com/codin… 参考这个帖子。
1.先用find命令找到libzmq.so.5的位置,默认安装应该是在/usr/local/bin下面
写入 /etc/ld.so.conf 文件,在运行/sbin/ldconfig -v 我理解是刷新缓存的意思
《jupyter notebook下安装go内核的一些坑》

好了之后运行 gophernotes就ok了 。
最后启动jupyter notebook。

《jupyter notebook下安装go内核的一些坑》

    原文作者:huang4207100
    原文地址: https://segmentfault.com/a/1190000015674501
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞