Cannot import third party packages on Linux (not even the ones in the README)
larsks opened this issue · comments
According to the README, under Linux I should be able to successfully import a third-party package like gnoum.org/v1/floats
like this:
gomacro> import ( "gonum.org/v1/floats" )
But this fails with:
// debug: looking for package "gonum.org/v1/floats" ...
error loading package "gonum.org/v1/floats" metadata: -: no required module provides package gonum.org/v1/floats; to add it:
go get gonum.org/v1/floats
This behavior occurs regardless of whether or not the local directory is an existing Go project or not. There are no GO*
environment variables in the local environment.
I'm using:
- Go version:
go version go1.19.4 linux/amd64
- gomacro version
2.7
(via Fedora packagegomacro-2.7-15.20210109git88cbcb5.fc35.x86_64
)
Is the import functionality only available in post-2.7 versions of the code?
If I replace the packaged version of gomacro
with the version installed by go install github.com/cosmos72/gomacro@latest
(which gets me v0.0.0-20221020183653-9aafa23692e7
), the import
statement fails with:
gomacro> import ( "gonum.org/v1/floats" )
// debug: running "go get gonum.org/v1/floats" ...
go: unrecognized import path "gonum.org/v1/floats": parse https://gonum.org/v1/floats?go-get=1: no go-import meta tags (meta tag gonum.org/v1/exp did not match import path gonum.org/v1/floats, meta tag gonum.org/v1/gonum did not match import path gonum.org/v1/floats, meta tag gonum.org/v1/hdf5 did not match import path gonum.org/v1/floats, meta tag gonum.org/v1/netlib did not match import path gonum.org/v1/floats, meta tag gonum.org/v1/plot did not match import path gonum.org/v1/floats, meta tag gonum.org/v1/tools did not match import path gonum.org/v1/floats)
repl.go:1:10: error importing packages map[gonum.org/v1/floats:]: error loading packages [gonum.org/v1/floats] metadata: error executing "/usr/local/pkg/go-1.19.4/bin/go get gonum.org/v1/floats" in directory "/home/lars/go/src/gomacro.imports/gomacro_pid_3470595/import_1": exit status 1
That may just mean that the referenced module no longer exists; import
seems to succeed with other third party modules, so perhaps the fix here is really just a doc update.
Thanks for spotting this!
Yes, it's a typo in the README: the package name should be gonum.org/v1/gonum/floats
Fixed in commit 12bd30a