gopherdata/gophernotes

error loading package "gonum.org/v1/gonum/mat"

hlalibe opened this issue · 3 comments

Hi,

Just installed, went fine, i can run all your examples in Display.ipynb without any error messages.

Now i wanted to try the examples in Matrix_Operations.ipynb, this code:

import (
    "fmt"
    "math"

    "gonum.org/v1/gonum/mat"
)

returns:
repl.go:5:5: error loading package "gonum.org/v1/gonum/mat" metadata, maybe you need to download (go get), compile (go build) and install (go install) it? can't find import: "gonum.org/v1/gonum/mat"

I can run go get commands from terminal normally.
I suspect something wrong with my installation, but not sure where to look.
Ubuntu 16.04
conda list ipython returns ipython 6.1.0
I'm using go version go1.9.7 linux/amd64

Hi @hlalibe,

the error message above assumes that the user knows how to install the desired go packages,
and merely reminds him/her to install them since they were not found.

To be precise, the exact commands to run may depend on the packages: each one may have its own installation procedure, but in most cases go get followed by go install -i is enough (the flag -i is essential).

In this case:

go get -v gonum.org/v1/gonum/mat
go install -v -i gonum.org/v1/gonum/mat

After these commands, does import "gonum.org/v1/gonum/mat"still produce the error you described ?

P.S. it's important to use the same go compiler version used to build gophernotes

thanks @cosmos72 it's working now. I'm new to Go and I thought as we give the internet address of a package that it would install it in the background if not present.
I had to remove the -i flag though from go install -v -i gonum.org/v1/gonum/mat as it would not install (from terminal).

So this example runs fine now, gophernotes/examples/Matrix_Operations.ipynb, the only thing is that i get a 64 <nil> or 121 <nil> after the output as displayed.

wiring go get foo.bar.com (go get downloads, compiles and installs, so no need for go install) as a Jupyter magic command would be an interesting PR :)