Can't install Revel (Unrecognized import path)

牧云@^-^@ 提交于 2019-12-07 10:31:13

问题


I'm a beginner in Go and I would like to use the Revel web framework. I installed: Git; Mercurial and even: Bazaar and CVS.

I checked my environment variables. I set environment variable GOPATH to D:\Go and added D:\Go\bin to PATH.But I still get these errors when I go get The Revel Framework (go get github.com/revel/revel)

**

  • package golang.org/x/net/websocket: unrecognized import path "golang.org/x/net/websocket"

  • package gopkg.in/fsnotify.v1: unrecognized import path "gopkg.in/fsnotify.v1"**


回答1:


For instalation of GO into your home folder you need this environment variables:

.
├── bin
├── go (GO)
└── src
    ├── revel.project
    │   ├── app
    │   │   ├── controllers
    │   │   ├── models
    │   │   ├── routes
    │   │   ├── tmp
    │   │   └── views
    │   │       ├── admin
    │   │       ├── App
    │   │       ├── errors
    │   │       └── users
    │   ├── conf
    │   ├── messages
    │   ├── public
    │   │   ├── css
    │   │   │   └── administrator
    │   │   ├── img
    │   │   ├── js
    │   │   └── uploads
    │   │       └── 1
    │   ├── resources
    │   ├── scripts
    │   ├── test-results
    │   └── tests
    ├── code.google.com
    ├── github.com
    │   ├── revel
    │   │   ├── cmd
    │   │   ├── modules
    │   │   └── revel

run this in your prompt path or modify if your folders are differents.

  export GOARCH=amd64
  export GOPATH=~/go
  export GOBIN=~/go/go/bin
  export GOROOT=~/go/go
  export PATH=$PATH:$GOPATH/go/bin
  export GOTOOLDIR=~/go/go/pkg/tool/linux_amd64
  export CC="gcc"
  export GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
  export CXX=g++
  export CGO_ENABLED=1

Where ~ is the name of you personal folder in the system (Bash Gnu Linux)



来源:https://stackoverflow.com/questions/29843116/cant-install-revel-unrecognized-import-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!