6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

gophernotes 環境を作るよ

Last updated at Posted at 2018-07-07

コードを試すにはlgoのほうが良さそう
lgo - Go (golang) をインタラクティブに実行するための Jupyter Notebook環境

Gophernotes とは

Gophernotes リポジトリ
Gophernotes docker image

golang の jupyter notebook / nteract kernel
go での機械学習が捗る
式評価に gomacro を利用している

gomacro

gomacro
go のインタラクティブインタプリタ、REPL
(試験的な Gnerics を持っている generics.md. 独自 debugger も持っている)

$ go get -u github.com/cosmos72/gomacro
$ gomacro

で REPL として使える

MacOS への環境構築

docker hub からイメージを持ってくる場合

$ docker pull dwhitena/gophernotes
$ docker run -it -p 8888:8888 gopherdata/gophernotes

ローカルに構築する場合

事前準備

  • Go 1.9+
  • jupyter notebook / nteract
  • ZeroMQ 4.X.X
  • pkg-config

install

$ go get github.com/gopherdata/gophernotes
$ mkdir -p ~/Library/Jupyter/kernels/gophernotes
$ cp $GOPATH/src/github.com/gopherdata/gophernotes/kernel/* ~/Library/Jupyter/kernels/gophernotes

MacOS 上で
gomacro のサードパーティライブラリをインポートする時に使う plugin パッケージを動作させるためには Go 1.10.2+ が必要みたい 
gomacro/issues/12

$ strip /path/to/gophernotes を実行してはいけない(Go 1.10.2+ on MacOS)
strip コマンド: 実行ファイルからアセンブラやリンクエディタからの出力にくっついているシンボルテーブルを削除したり、変更したりするコマンド

gophernotes/vender 下の pebbe/zmq4 は, ZeroMQ 4.2.3 (2018/07/07 時点)
ZewoMQ のバージョンがシビアなので、ローカルのバージョンを合わせる

参考にしました
Homebrewで旧バージョンのパッケージをインストールしたい

目次ページ
Machine Learning with Go 読書記録

6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?