Viper: unrecognized import path "golang.org/x/sys/unix"

Created on 1 Jan 2018  路  3Comments  路  Source: spf13/viper

When I am trying to run the below command, in Ubuntu 16.04 LTS,

go get github.com/spf13/viper

I am getting below error,
girish@girish-VirtualBox:~$ go get github.com/spf13/viper
package golang.org/x/sys/unix: unrecognized import path "golang.org/x/sys/unix" (https fetch: Get https://golang.org/x/sys/unix?go-get=1: dial tcp 172.217.26.209:443: i/o timeout)
package golang.org/x/text/transform: unrecognized import path "golang.org/x/text/transform" (https fetch: Get https://golang.org/x/text/transform?go-get=1: dial tcp 172.217.26.209:443: i/o timeout)
package golang.org/x/text/unicode/norm: unrecognized import path "golang.org/x/text/unicode/norm" (https fetch: Get https://golang.org/x/text/unicode/norm?go-get=1: dial tcp 172.217.26.209:443: i/o timeout)

My go env entires are as follows,

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/girish/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build644128295=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

Most helpful comment

I got the same issue, fix by download packages manually.

mkdir -p $GOPATH/src/golang.org/x/
cd !$
git clone https://github.com/golang/sys.git
git clone https://github.com/golang/text.git

All 3 comments

I got the same issue, fix by download packages manually.

mkdir -p $GOPATH/src/golang.org/x/
cd !$
git clone https://github.com/golang/sys.git
git clone https://github.com/golang/text.git

For the benefit of others, git clone https://github.com/golang/sys.git did not work for me, I had to do git clone https://go.googlesource.com/sys

For me, the above solutions don't work. If it is the proxy problem, try to use the following setting for golang.
export GO111MODULE=on
export GOPROXY=https://goproxy.io

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GrapeBaBa picture GrapeBaBa  路  5Comments

alfmos picture alfmos  路  3Comments

orian picture orian  路  4Comments

TWinsnes picture TWinsnes  路  3Comments

gmaxwell94 picture gmaxwell94  路  5Comments