gopherdata / gophernotes

The Go kernel for Jupyter notebooks and nteract.
MIT License
3.8k stars 262 forks source link

Unable to run notebook with error: packages.Load() could not find package #216

Closed kortschak closed 3 years ago

kortschak commented 3 years ago

Gophernotes looks like it's failing again for me. Attempting to run the notebook at https://mybinder.org/v2/gh/kortschak/graphprac/master?filepath=graph-prac.ipynb gives the following (Go1.13).

error loading package "github.com/kortschak/graphprac" metadata: packages.Load() could not find package "github.com/kortschak/graphprac"

I get this error when running locally (Go1.15).

error loading package "github.com/kortschak/graphprac" metadata: -: cannot find module providing package github.com/kortschak/graphprac: working directory is not part of a module

I don't know if this is related to #184, but the local error suggests so.

kortschak commented 3 years ago

I have just reinstalled gophernotes locally with version v0.7.1 and it is working locally, so this issue becomes a question about what it is that I'm doing wrong in the postBuild on the MyBinder configuration. I'll have a little play to see if I can fix that.

kortschak commented 3 years ago

Resolved with some care given to the postBuild.

cosmos72 commented 3 years ago

Good to hear that you solved this problem.

Would you care to post the differences between the 'broken' and the 'working' build script ?

Or maybe the critical parts were the following?

export GO111MODULE=on
# ...
go get github.com/gopherdata/gophernotes@v0.7.1
kortschak commented 3 years ago

The change that fixed the problem was this. Within that mess, I'd say the crucial lines are ones that you mentioned and then copying and replacing the kernel.json to include the $GOROOT and updated $PATH that otherwise lacks the go tool.