Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package context: unrecognized import path "context" (import path does not begin with hostname) #1985

Open
jpwhitney opened this issue Aug 11, 2018 · 12 comments

Comments

Projects
None yet
7 participants
@jpwhitney
Copy link

commented Aug 11, 2018

I ran
go get -u github.com/golang/dep/cmd/dep
and I got
package context: unrecognized import path "context" (import path does not begin with hostname)

I'm on Ubuntu 16.04.

How can I fix this? Is this a known issue?

@Zwei-Raben

This comment has been minimized.

Copy link

commented Aug 29, 2018

same here

@jpwhitney

This comment has been minimized.

Copy link
Author

commented Aug 29, 2018

I think I fixed this by installing latest version of Go. What version do you have?

@Zwei-Raben

This comment has been minimized.

Copy link

commented Aug 29, 2018

root@hostname:~/go/src/github.com/kotakanbe/go-cve-dictionary# go version
go version go1.10.1 linux/amd64

i think the latest you could have

@jpwhitney

This comment has been minimized.

Copy link
Author

commented Aug 29, 2018

It may just have been a path issue.

1 similar comment
@jpwhitney

This comment has been minimized.

Copy link
Author

commented Aug 29, 2018

It may just have been a path issue.

@Zwei-Raben

This comment has been minimized.

Copy link

commented Aug 29, 2018

Would you mind showing me your go env?

@Zwei-Raben

This comment has been minimized.

Copy link

commented Sep 5, 2018

missing package installable by
git clone https://github.com/gorilla/context /root/go/src/github.com/golang/dep/vendor/context

@sdboyer

This comment has been minimized.

Copy link
Member

commented Sep 6, 2018

This is pretty bizarre - context has been in stdlib for some time. i've no idea how that outcome could occur on go 10.1 😕

@ExVladimir

This comment has been minimized.

Copy link

commented Nov 8, 2018

sudo apt-get purge golang*
sudo rm -rf /usr/lib/go-1.6/ /usr/lib/go-1.6/src/ /usr/lib/go-1.6/src/runtime/ /usr/lib/go-1.6/src/runtime/race
curl -O https://storage.googleapis.com/golang/go1.11.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.11.1.linux-amd64.tar.gz
mkdir -p ~/go; echo "export GOPATH=$HOME/go" >> ~/.bashrc
echo "export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
go get github.com/go-sql-driver/mysql
It's work for me.

@alpheustechnologies

This comment has been minimized.

Copy link

commented Nov 14, 2018

This solution worked for me. Thank you.

sudo apt-get purge golang*
sudo rm -rf /usr/lib/go-1.6/ /usr/lib/go-1.6/src/ /usr/lib/go-1.6/src/runtime/ /usr/lib/go-1.6/src/runtime/race
curl -O https://storage.googleapis.com/golang/go1.11.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.11.1.linux-amd64.tar.gz
mkdir -p ~/go; echo "export GOPATH=$HOME/go" >> ~/.bashrc
echo "export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
go get github.com/mattn/goreman

@zouchengli

This comment has been minimized.

Copy link

commented Feb 1, 2019

This solution worked for me. Very thanks.

sudo apt-get purge golang*
sudo rm -rf /usr/lib/go-1.6/ /usr/lib/go-1.6/src/ /usr/lib/go-1.6/src/runtime/ /usr/lib/go-1.6/src/runtime/race
curl -O https://storage.googleapis.com/golang/go1.11.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.11.1.linux-amd64.tar.gz
mkdir -p ~/go; echo "export GOPATH=$HOME/go" >> ~/.bashrc
echo "export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
go/github.com/zouchengli
It's work for me.

@ss62171

This comment has been minimized.

Copy link

commented Apr 7, 2019

export GOROOT=/usr/local/go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.