go get fyne/io/driver/gl#v1.0.1 unrecognized import path - go

Trying to follow the installation guide here and most of the process is working. I'm having an issue with building it however.
When trying to build I'm getting this message:
C:...\gameboy.live>go build -o gbdotlive main.go
......\go\pkg\mod\fyne.io\fyne#v1.0.1\driver\gl\gl.go:20:2: missing go.sum entry for module providing package github.com/goki/freetype (imported by fyne.io/fyne/driver/gl); to add:
go get fyne.io/fyne/driver/gl#v1.0.1
Running the suggested command however raises another prompt:
C:...\gameboy.live>go get fyne.io/driver/gl#v1.0.1
go get fyne.io/driver/gl#v1.0.1: unrecognized import path "fyne.io/driver/gl": reading https://fyne.io/driver/gl?go-get=1: 404 Not Found
I've tried going for the version 1.4.3 driver too which raises a different error:
C:...\gameboy.live>go get fyne.io/fyne/gl#v1.4.3
go get: module fyne.io/fyne#v1.4.3 found, but does not contain package fyne.io/fyne/gl
Anybody familiar with this issue? FYI I'm on Windows and have MinGw installed already.

Just run go mod tidy before exec go build -o gbdotlive main.go.Have a try.

Related

Trouble with go get install for mcumgr

I am trying to install MCUMgr on MACos. Here is a link for mcumgr: https://docs.zephyrproject.org/latest/services/device_mgmt/mcumgr.html
I install the Go Programming Language and enter this command:
go install github.com/apache/mynewt-mcumgr-cli/mcumgr#latest
Upon doing this I get the following error:
go/pkg/mod/golang.org/x/sys#v0.0.0-20200223170610-d5e6a3e2c0ae/unix/zsyscall_darwin_amd64.go:28:3: //go:linkname must refer to declared function or variable
I then googled and found the following from stackoverflow: Go 1.18 build error on Mac: "unix/syscall_darwin.1_13.go:25:3: //go:linkname must refer to declared function or variable"
This gives me the following error:
go: golang.org/x/sys: unrecognized import path "golang.org/x": parse https://golang.org/x?go-get=1: no go-import meta tags ()
I am stuck right now on how to install MCUMgr for MACos and wondering if someone has previously had the same issues?
I used go 1.17 instead and used:
go get github.com/apache/mynewt-mcumgr-cli/mcumgr
Then into the bin folder where it is installed use sudo ./mcumgr to run.

What does it mean the code in my directory "expects" a particular import?

A Go language tutorial uses the "quote" package to get familiar quotes. When I give the command "go get -v rsc.io/quote", I get the message
code in directory.../github/hello/src/rsc.io/quote/v3 expects import "rsc.io/quote"
So I went there and looked at the code. It has an import statement:
import "rsc.io/quote/v3"
So I thought maybe I had the wrong version of quote. Accordingly, I tried "go get -v rsc.io/quite/v3" THis produces the message:
code in directory .../rsc.io/quote/v3 expects import "rsc.io/quote."
This seems circular: asking without a version number produces a requirement for a versioned package, but trying to get a versioned package produces a requirement without a version number.
If you continue the tutorial to the end you will see that the addition of a go module, and the subsequent initialisation, will resolve your issue. The .mod file will pull in the required dependencies.
Can you try
go get -v rsc.io/quote
get "rsc.io/quote": found meta tag get.metaImport{Prefix:"rsc.io/quote", VCS:"git", RepoRoot:"https://github.com/rsc/quote"} at //rsc.io/quote?go-get=1
rsc.io/quote (download)
get "rsc.io/sampler": found meta tag get.metaImport{Prefix:"rsc.io/sampler", VCS:"git", RepoRoot:"https://github.com/rsc/sampler"} at //rsc.io/sampler?go-get=1
rsc.io/sampler (download)
github/gospace/src/rsc.io/quote/quote.go:8:8: code in directory /Users/james/github/gospace/src/rsc.io/quote/v3 expects import "rsc.io/quote"
cat $GOPATH/src/rsc.io/quote/v3/go.mod
module rsc.io/quote/v3
require rsc.io/sampler v1.3.0
~> cat $GOPATH/src/rsc.io/quote/v3/go.sum
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c h1:qgOY6WgZOaTkIIMiVjBQcw93ERBE4m30iBm00nkL0i8=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
rsc.io/sampler v1.99.99 h1:7i08f/p5TBU5joCPW3GjWG1ZFCmr28ybGqlXtelhEK8=
rsc.io/sampler v1.99.99/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
More about go get vs go install. What is the difference between go get and go install?
Can you please check your GO env path settings:
export GOPATH=$HOME/github/<your_workspace_name>
export GOBIN=$GOPATH/bin
export GOROOT=/usr/local/go
export PATH=$PATH:/usr/local/bin:/usr/local/go/bin:$GOPATH/bin
Here is a good source for setting up workspace:
https://golang.org/doc/gopath_code.html
As #MartinBennett mentioned, it's already mentioned in the tutorial but may be not so clear.
Once you add import "rsc.io/quote" in your hello.go file, you will need to run these commands in your terminal:
1-
go mod init hello
2-
go run hello.go

Unable to Install Go-Ipfs from source

I'm trying to Build IPFS from Source on windows 10.
Previously i installed it from source.It was working fine. But i needed the latest source so i started again from the scratch. because i edited some parts in the source.
I followed instructions on https://github.com/ipfs/go-ipfs/blob/master/docs/windows.md.
I received following error on executing following commands.
code
cd %GOPATH%\src\github.com\ipfs\go-ipfs
make install
Error
go version go1.12.6 windows/amd64
bin/check_go_version 1.12
go install -asmflags=all=-trimpath="D:\GO_WORKSPACE" -gcflags=all=-trimpath="D:\GO_WORKSPACE" -ldflags="-X "github.com/ipfs/go-ipfs".CurrentCommit=810cb607e-dirty" ./cmd/ipfs
# github.com/ipfs/go-ipfs/plugin/loader
plugin\loader\preload.go:11:2: undefined: pluginipldgit
plugin\loader\preload.go:12:2: undefined: pluginbadgerds
plugin\loader\preload.go:13:2: undefined: pluginflatfs
plugin\loader\preload.go:14:2: undefined: pluginlevelds
make: *** [cmd/ipfs/Rules.mk:37: cmd/ipfs-install] Error 2
I tried Adding this plugins in to preload.go file under src\github.com\ipfs\go-ipfs\plugin\loader directory.
exisiting code on preload.go.
import (
"github.com/ipfs/go-ipfs/plugin"
)
i added after the issue
import (
"github.com/ipfs/go-ipfs/plugin"
pluginipldgit "github.com/ipfs/go-ipfs/plugin/plugins/git"
pluginbadgerds "github.com/ipfs/go-ipfs/plugin/plugins/git"
pluginflatfs "github.com/ipfs/go-ipfs/plugin/plugins/git"
pluginlevelds "github.com/ipfs/go-ipfs/plugin/plugins/git"
)
so after i added this lines result is success.
Executed command
make install
Result
go version go1.12.6 windows/amd64
bin/check_go_version 1.12
go install -asmflags=all=-trimpath="D:\GO_WORKSPACE" -gcflags=all=-trimpath="D:\GO_WORKSPACE" -ldflags="-X "github.com/ipfs/go-ipfs".CurrentCommit=810cb607e-dirty" ./cmd/ipfs
Then i tried to start the ipfs using following command
ipfs daemon
Error
Initializing daemon...
go-ipfs version: 0.4.22-dev-810cb607e-dirty
Repo version: 7
System version: amd64/windows
Golang version: go1.12.6
Error: unknown datastore type: flatfs
Can someone help me configure the IPFS from source.
Thanks in advance.
I solved this problem by following method. not sure this will be a good solution or not. any way i could solve the issue.
I'm posting this as a answer. so it will be useful to everyone who has the same issue.
1) Deleted go-ipfs folder inside the "%GO_WORKSPACE% / .... / ipfs" folder.
2) Git clone the go ipfs repo manually on the same location.
3) go inside go-ipfs folder.
4) execute install command.
make install
Done on Windows.
Save IPFS (kubo) to some folder inside %GOPATH% (I cloned https://github.com/ipfs/kubo) to folder %GOPATH%\kubo
Important cd %GOPATH%\kubo\cmd\ipfs\
go install
ipfs.exe was placed in %GOPATH%\bin
I launched it as daemon - works.
BTW: GOROOT is defined and path to go is included in PATH

read-the-docs: ImportError despite dependency being set in setup.py

Consider this build error:
I see lines like: ImportError: No module named swisseph and invalid signature for automodule (u'jyotisha\n :members:'). My setup.py does include pyswisseph as a dependency already.. What's a good fix?
PS: My local sphinx build seems fine.
Following #steve-piercy's tip and the FAQ, I was able to get past this error - I just needed to to enable the virtualenv feature in the Admin page of my project.
The install then fails for another (as yet undebugged reason) - but that's separate.

Getting wrong when installing tensorflow from source

I had been trying to install tensorflow for a few day. However, cuda 7.5 is the version that tensorflow r0.10.0 supports default. So I can only install it from source. But I came after the following problem which bother me a lot.
.....
INFO: Reading options for 'clean' from /home/lhx/tensorflow-r0.10/tools/bazel.rc:
Inherited 'build' options: --force_python=py2 --host_force_python=py2 --python2_path=/usr/bin/python --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --define PYTHON_BIN_PATH=/usr/bin/python --spawn_strategy=standalone --genrule_strategy=standalone
Unrecognized option: --host_force_python=py2
ERROR: /home/lhx/tensorflow-r0.10/WORKSPACE:18:6: First argument of load() is a path, not a label. It should start with a single slash if it is an absolute path..
ERROR: /home/lhx/tensorflow-r0.10/WORKSPACE:22:6: First argument of load() is a path, not a label. It should start with a single slash if it is an absolute path..
ERROR: WORKSPACE file could not be parsed.
ERROR: package contains errors: third_party/boringssl.
ERROR: no such package 'external': Package 'external' contains errors.
Configuration finished
I just can't figure out what is going wrong and I have been trying for so long.
I experienced similar errors when my bazel was too outdated. You can try newer bazel version.

Resources