Skip to content

Commit 3b43e94

Browse files
committed
README.md: write more robust installation instructions for Linux and Mac OS X
1 parent c090149 commit 3b43e94

File tree

3 files changed

+53
-13
lines changed

3 files changed

+53
-13
lines changed

README.md

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,32 @@
4747

4848
### Linux
4949

50+
Quick installation as module, requires Go 1.12+
5051
```sh
51-
$ go get -u github.com/gopherdata/gophernotes
52+
$ env GO111MODULE=on go get github.com/gopherdata/gophernotes
5253
$ mkdir -p ~/.local/share/jupyter/kernels/gophernotes
53-
$ cp $GOPATH/src/github.com/gopherdata/gophernotes/kernel/* ~/.local/share/jupyter/kernels/gophernotes
54+
$ cd ~/.local/share/jupyter/kernels/gophernotes
55+
$ cp "$(go env GOPATH)"/pkg/mod/github.com/gopherdata/gophernotes@v0.6.0/kernel/* "."
56+
$ sed "s|gophernotes|$(go env GOPATH)/bin/gophernotes|" < kernel.json.in > kernel.json
5457
```
5558

56-
To confirm that the `gophernotes` binary is installed and in your PATH, you should see the following when running `gophernotes` directly:
59+
Manual installation from GOPATH, also works with Go 1.11
60+
```sh
61+
$ env GO111MODULE=off go get -d github.com/gopherdata/gophernotes
62+
$ cd "$(go env GOPATH)"/src/github.com/gopherdata/gophernotes
63+
$ env GO111MODULE=on go install
64+
$ mkdir -p ~/.local/share/jupyter/kernels/gophernotes
65+
$ cp kernel/* ~/.local/share/jupyter/kernels/gophernotes
66+
$ cd ~/.local/share/jupyter/kernels/gophernotes
67+
$ sed "s,gophernotes,$(go env GOPATH)/bin/gophernotes," < kernel.json.in > kernel.json
68+
```
5769

70+
To confirm that the `gophernotes` binary is installed in GOPATH, execute it directly:
71+
```sh
72+
$ "$(go env GOPATH)"/bin/gophernotes
73+
```
74+
and you shoud see the following:
5875
```sh
59-
$ gophernotes
6076
2017/09/20 10:33:12 Need a command line argument specifying the connection file.
6177
```
6278

@@ -68,19 +84,34 @@ $ jupyter --data-dir
6884

6985
### Mac
7086

71-
**Important Note** - gomacro relies on the `plugin` package when importing third party libraries. This package works reliably on Mac OS X only with Go 1.10.2+ as long as you **never** execute the command `strip gophernotes`.
72-
If you can only compile gophernotes with Go <= 1.10.1 on Mac, consider using the [Docker](#docker) install and run gophernotes/Jupyter in Docker.
87+
**Important Note** - gomacro relies on the `plugin` package when importing third party libraries. This package works reliably on Mac OS X with Go 1.10.2+ as long as you **never** execute the command `strip gophernotes`.
7388

89+
Quick installation as module, requires Go 1.12+
7490
```sh
75-
$ go get -u github.com/gopherdata/gophernotes
91+
$ env GO111MODULE=on go get github.com/gopherdata/gophernotes
7692
$ mkdir -p ~/Library/Jupyter/kernels/gophernotes
77-
$ cp $GOPATH/src/github.com/gopherdata/gophernotes/kernel/* ~/Library/Jupyter/kernels/gophernotes
93+
$ cd ~/Library/Jupyter/kernels/gophernotes
94+
$ cp "$(go env GOPATH)"/pkg/mod/github.com/gopherdata/gophernotes@v0.6.0/kernel/* "."
95+
$ sed "s|gophernotes|$(go env GOPATH)/bin/gophernotes|" < kernel.json.in > kernel.json
7896
```
7997

80-
To confirm that the `gophernotes` binary is installed and in your PATH, you should see the following when running `gophernotes` directly:
98+
Manual installation from GOPATH, also works with Go 1.11
99+
```sh
100+
$ env GO111MODULE=off go get -d github.com/gopherdata/gophernotes
101+
$ cd "$(go env GOPATH)"/src/github.com/gopherdata/gophernotes
102+
$ env GO111MODULE=on go install
103+
$ mkdir -p ~/Library/Jupyter/kernels/gophernotes
104+
$ cp kernel/* ~/Library/Jupyter/kernels/gophernotes
105+
$ cd ~/Library/Jupyter/kernels/gophernotes
106+
$ sed "s,gophernotes,$(go env GOPATH)/bin/gophernotes," < kernel.json.in > kernel.json
107+
```
81108

109+
To confirm that the `gophernotes` binary is installed in GOPATH, execute it directly:
110+
```sh
111+
$ "$(go env GOPATH)"/bin/gophernotes
112+
```
113+
and you shoud see the following:
82114
```sh
83-
$ gophernotes
84115
2017/09/20 10:33:12 Need a command line argument specifying the connection file.
85116
```
86117

kernel/kernel.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"argv": [
3-
"gophernotes",
4-
"{connection_file}"
5-
],
3+
"gophernotes",
4+
"{connection_file}"
5+
],
66
"display_name": "Go",
77
"language": "go",
88
"name": "go"

kernel/kernel.json.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"argv": [
3+
"gophernotes",
4+
"{connection_file}"
5+
],
6+
"display_name": "Go",
7+
"language": "go",
8+
"name": "go"
9+
}

0 commit comments

Comments
 (0)