golang ambiguous import using SDL - go

i am trying to get sdl working on linux mint and golang, i hav tried to install it using the commands on the github page and the i tried importing it
package main
import (
"fmt"
"github.com/veandco/go-sdl2/sdl"
)
but when ever i try to run it go buld main.go it spits out this error
main.go:6:2: ambiguous import: found package github.com/veandco/go-sdl2/sdl in multiple modules:
github.com/veandco/go-sdl2 v0.4.25 (/home/user/go/pkg/mod/github.com/veandco/go-sdl2#v0.4.25/sdl)
github.com/veandco/go-sdl2/sdl (/home/user/Desktop/golang/gui)
i have tried removing the file and re-installing it but it doesn't seem to work, i know it's probely my fault it's not working, thanks in advance (sorry for any bad english or grammer)

Related

Tried to install github.com/go-sql-driver/mysql but there's an error when I tried importing

First i created a folder called sqltest the run the go mod init. And then I installed the mysql by running the code below
go get -u github.com/go-sql-driver/mysql
However when I tried to import "github.com/go-sql-driver/mysql, it has an error
it says could not import github.com/go-sql-driver/mysql (no required module provides package "github.com/go-sql-driver/mysql")compilerBrokenImport
I tried to delete the go-sql-driver and re-install it but nothing happens
Does the import look like?
import (
_ "github.com/go-sql-driver/mysql"
)

Why can't I install a library with a minus sign in it?

I'm new to Python and I'm trying to import a module that I installed, "python-evtx". I successfully installed it, but when I try to import it in the environment (Python 3.10.9) using Idle I get a syntax error that points at the "-" sign. As far as I can tell, import chokes on that"-" sign. Can anybody help? Thanks!
Here is a screenshot of my issue:
(https://i.stack.imgur.com/h9oxj.png)

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

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.

Issues with Binance Package

Having some trouble importing the Binance package into python. Specifically, I can't run the following lines:
from binance.client import Client
from binance.enums import *
When I install binance into my environment using this link [pip install python-binance], The code gets hung up on line one at >> from binance.client import Client. The import error I get is the following:
ImportError: dlopen(/Users/name/.local/lib/python3.9/site-packages/regex/_regex.cpython-39-darwin.so, 2): no suitable image found. Did find:
/Users/name/.local/lib/python3.9/site-packages/regex/_regex.cpython-39-darwin.so: mach-o, but wrong architecture
/Users/name/.local/lib/python3.9/site-packages/regex/_regex.cpython-39-darwin.so: mach-o, but wrong architecture
Admittedly I'm not an expert in managing envs so any help would be greatly appreciated!
Cheers

import object is expected Error in Golang 1.4.2

I have just upgraded Golang from 1.3 to version 1.4.2. And cannot compile due to error:
../../my/mandrill.go:5: import /path/to/go/home/pkg/darwin_amd64/github.com/keighl/mandrill.a: object is [darwin amd64 go1.3.3 X:precisestack] expected [darwin amd64 go1.4.2 X:precisestack]
FAIL folder [build failed]
on line m "github.com/keighl/mandrill"
package my
import (
"fmt"
m "github.com/keighl/mandrill"
)
I guess some rules of importing have changed in 1.4.2. But cannot figure out how to change my import code to make it compile.
Just delete the old pkg files, usually it upgrades automatically though.
rm -rf $GOPATH/pkg/
I met this problem too. I deleted the old packages but still get same error. finally I found the old pkg keep get generated by my "sublime text2". after restarted it. everything back to work :p

Resources