无法安装Revel(无法识别的导入路径) [英] Can't install Revel (Unrecognized import path)
问题描述
我是Go语言的初学者,我想使用Revel网络框架. 我安装了:Git; Mercurial甚至:Bazaar和CVS.
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.
我检查了环境变量.我将环境变量GOPATH设置为D:\ Go并将D:\ Go \ bin添加到PATH.但是当我 去获取The Revel Framework (去获取github.com/revel/revel)
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)
**
-
软件包golang.org/x/net/websocket:无法识别的导入路径"golang.org/x/net/websocket"
package golang.org/x/net/websocket: unrecognized import path "golang.org/x/net/websocket"
软件包gopkg.in/fsnotify.v1:无法识别的导入路径"gopkg.in/fsnotify.v1" **
package gopkg.in/fsnotify.v1: unrecognized import path "gopkg.in/fsnotify.v1"**
推荐答案
要将GO安装到主文件夹中,您需要以下环境变量:
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
〜是您在系统(Bash Gnu Linux)中个人文件夹的名称
Where ~ is the name of you personal folder in the system (Bash Gnu Linux)
这篇关于无法安装Revel(无法识别的导入路径)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!