官网安装方法:
https://github.com/gopherdata/gophernotes#linux
一、下载gophernotes
从github上下载
https://github.com/gopherdata/gophernotes
或
sudo su
yum install -y zeromq zeromq-devel
# go get -u github.com/gopherdata/gophernotes # 下载多次失败,采用网页下载
# 网页下载
wget https://github.com/gopherdata/gophernotes/archive/master.zip
unzip gophernotes-master.zip
mv gophernotes-master/* $GOPATH/src/github.com/gopherdata/gophernotes/
go build github.com/gopherdata/gophernotes
go install github.com/gopherdata/gophernotes
mkdir -p ~/.local/share/jupyter/kernels/gophernotes
cp $GOPATH/src/github.com/gopherdata/gophernotes/kernel/* ~/.local/share/jupyter/kernels/gophernotes
# 制定具体的路径
vi ~/.local/share/jupyter/kernels/gophernotes/kernel.json
{
"argv": [
"/mnt/S_LINUX_DATA/mycode/golang/bin/gophernotes",
"{connection_file}"
],
"display_name": "Go",
"language": "go",
"name": "go"
}
# 启动程序进行测试
/usr/local/python374/bin/jupyter-notebook --config=/mnt/S_LINUX_DATA/mycode/jupyter/config/jupyter_notebook_config.py --no-browser -y --allow-root
二、创建内核:
mkdir -p ~/.local/share/jupyter/kernels/gophernotes
cp $GOPATH/src/github.com/gopherdata/gophernotes/kernel/* ~/.local/share/jupyter/kernels/gophernotes
# 或者
mkdir -p /usr/local/share/jupyter/kernels/gophernotes
cp $GOPATH/src/github.com/gopherdata/gophernotes/kernel/* /usr/local/share/jupyter/kernels/gophernotes
三、go安装好,把GOPATH/bin的目录加入到PATH中,然后重启 最后启动jupyter notebook。
四、测试
五、错误处理
1、报错
go get -u github.com/gopherdata/gophernotes
# pkg-config --cflags -- libzmq
Package libzmq was not found in the pkg-config search path.
Perhaps you should add the directory containing `libzmq.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libzmq' found
pkg-config: exit status 1
解决: sudo yum install -y zeromq zeromq-devel