Not working in module mode #184
Comments
|
Note that gomacro as of cosmos72/gomacro@24fc920 executes the code that fails here without issue. |
|
OT: gophernotes dropped support of Go 1.10. So we can remove vendor. |
|
https://github.com/cosmos72/gomacro has a I am working to fix that. |
|
I added modules support to gomacro - i.e. |
|
It should work now, waiting for @kortschak confirmation before closing |
|
Question, when importing different version of module which is already used in gophernotes's dependencies, what you expect?
|
|
I expect exactly the error you report, because I already thought about this problem in the past, and there are two complementary solutions:
These are future improvements for gophernotes (1) and gomacro (2) |
|
This is fixed for me as noted in the PR. |
|
If I want to use packages in the document and the packages are used in gophernotes, I should set GO111MODULE=off ? |
|
Environment GO111MODULE is now ignored by gophernotes at runtime: internally, it always sets it to Anyway there should be very few packages used in gophernotes without a corresponding import file in 'imports' directory: Maybe I am missing something? |
|
I could solve issue that can't import packages which is used in gophernotes. One another issue is that can't import packages in different versions. I'm trying to use my package https://github.com/mattn/go-pairplot and this import golang.org/x/image but gonum.org/v1/plot/vg also import golnang.org/x/image/font/fixed. |
|
Hmm, importing "github.com/mattn/go-runewidth" fail. |
|
Not sure if that's related but 'gopls' also fails to import 'runewidth' (this happens when trying to 'gorename' something in one of my packages that happens to import a pkg that, down the line, imports that 'runewidth' package.) |
|
Hmm, I played using go-runewidth for a little while but I don't see the fail. |
|
Anyone could you please try import "github.com/mattn/go-plotlib" ? |
|
error loading plugin "/home/max/go/src/gomacro.imports/github.com/mattn/go-plotlib/go-plotlib.so": plugin.Open("/home/max/go/src/gomacro.imports/github.com/mattn/go-plotlib/go-plotlib"): plugin was built with a different version of package github.com/mattn/go-runewidthThe reason is the following: But gophernotes depends on the most recent tagged version of So The only real solution is for @peterh to release a newer version of his |
|
I'm disinclined to release a new version of liner every time a 3rd party package sneezes. Fortunately, it appears that this is not "the only real solution" for @cosmos72 . If I understand the Go module system correctly, "0.0.3" really means "0.x.y, where x >= 0 and y >= 3". So it should allow you to specify |
|
Thanks for the suggestion, I will try it. |
|
I updated gomacro/go.mod to explicitly |
|
About the other issues listed above:
|
|
I got similar issue when trying
I get
It seems it tries to load from Sorry for bumping old issue - can open new one if this is some new problem. |
|
Gophernotes should ignore the contents of current directory when importing packages: Maybe both packages depend on |
Coming to Go from Python background, I used to do a lot of my development by writing Python code in In some regards you could say that Jupyter Notebook was my IDE. I hoped that Gophernotes could serve the same purpose for Go. Wonder if worth opening another issue for it? |
|
There should be an open issue that, among other things, proposes to implement Feel free to open a new issue on this topic. If you can explain in detail the behavior you expect, even better :) |
|
Sorry off topic. Can I import specific version of package in notebook? |
Better to discuss this in a separate issue - I opened #218 |

I am trying to run github.com/kortschak/graphprac on my local machine. I always run with module mode on, Go version 1.13.
When I try to run the first cell of the notebook at that repo I get a failure that the build with buildmode=plugin failed. When I execute this in a terminal to investigate I see that it's because the go tool expects the go.mod file to exist and bails otherwise. Creating a go mod file in that directory allows the build to complete and also allows the cell to execute on the notebook.
Perhaps the go.mod from imported packages' modules could be placed in the gomacro build paths.
At the very least, it should be noted that it might be necessary to invoke the server with
GO111MODULE=off jupyter notebook.The text was updated successfully, but these errors were encountered: