欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Centos7.6安装工具(7)--安装gophernotes(jupyter notebook下安装go内核)

程序员文章站 2022-05-29 09:40:08
...

官网安装方法:

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

 

 

 

 

 

转载于:https://my.oschina.net/mengyoufengyu/blog/3086472