Closed ray-harris closed 4 years ago
Thanks for the detailed report :) It's a known limitation of the underlying Go interpreter, I am working to add modules support to it.
I added modules support to the underlying Go interpreter. ASAP I will update gophernotes to use it.
working on it, see https://github.com/gopherdata/gophernotes/pull/189
modules support added. I will check again the issues listed above and see if some are still open.
To my knowledge, issue 1 3 and 4 have been fixed.
Issue 2 is a warning (not an error) and now it happens only if you ask gophernotes to write import files inside gophernotes source directory with import _b "path/to/some/package"
Since $GOPATH/src
is usually writeable but source code downloaded as module in $GOPATH/pkg/mod
is not writeable, such warning is still useful.
Summary ISSUE 1: Source path for copying the kernel is incorrect in README.md ISSUE 2: gophernotes looks for gomacro in $GOPATH, not as a module. ISSUE 3: imports in a notebook don't find the module ISSUE 4: gomacro does not add an import for package unsafe from the standard library
Pre-install environment
Installation
ISSUE 1: Source path for copying the kernel is incorrect in README.md.
Workaround: Since the
go get
command put gophernotes in$GOPATH/pkg/mod/github.com/gopherdata/gophernotes@v0.5.0
, I changed the source path:Test Installation
ISSUE 2: gophernotes looks for gomacro in $GOPATH, not as a module.
Workaround: Install gomacro in gopath mode.
Start a Go Jupyter Notebook
ISSUE 3: imports in a notebook don't find the module
Create a new notebook:
New
->Go
in Jupyter home pageRun this in a cell:
I have the repo as module:
Workaround:
I tried to get the repo in gopath mode:
I then restarted the jupyter notebook and ran the cell in a new notebook:
I shut down the jupyter notebook and then restarted it with
GO111MODULE=off
At this point I was able to use the package.
ISSUE 4: gomacro does not add an import for package unsafe from the standard library
I tried to use another package:
From
$GOPATH/src/gomacro_imports/gorgonia.org/tensor/tensor.go
:Original code that is being proxied is here:
https://github.com/gorgonia/tensor/blob/master/engine.go#L16
I don't know how to work around this issue.