Go Glide 错误 “系统找不到指定的路径”

huangapple go评论86阅读模式
英文:

Go Glide Error "The system cannot find the path specified"

问题

我正在尝试使用glide管理我的Go项目。

我执行了glide update命令,但是出现了以下错误:The system cannot find the path specified

C:\path\to\myproject\src>glide update
[INFO]  Downloading dependencies. Please wait...
[INFO]  --> Fetching google.golang.org/appengine.
[INFO]  --> Fetching cloud.google.com/go.
[INFO]  --> Fetching golang.org/x/net.
[INFO]  --> Fetching github.com/gin-gonic/gin.
[INFO]  --> Fetching google.golang.org/api.
[INFO]  --> Fetching golang.org/x/oauth2.
[INFO]  --> Detected semantic version. Setting version for github.com/gin-gonic/gin to v1.1.4.
[INFO]  --> Detected semantic version. Setting version for google.golang.org/appengine to v1.0.0.
[INFO]  --> Detected semantic version. Setting version for cloud.google.com/go to v0.7.0.
[INFO]  Resolving imports
[INFO]  Found Godeps.json file in C:\Users\myhome\.glide\cache\src\https-github.com-gin-gonic-gin
[INFO]  --> Parsing Godeps metadata...
[INFO]  --> Fetching github.com/manucorporat/sse.
[INFO]  --> Setting version for github.com/manucorporat/sse to ee05b128a739a0fb76c7ebd3ae4810c1de808d6d.
[INFO]  --> Fetching github.com/mattn/go-isatty.
[INFO]  --> Setting version for golang.org/x/net to f315505cf3349909cdf013ea56690da34e96a451.
[INFO]  --> Fetching github.com/golang/protobuf.
[INFO]  --> Setting version for github.com/golang/protobuf to 2402d76f3d41f928c7902a765dfc872356dd3aad.
[INFO]  --> Fetching github.com/googleapis/gax-go.
[INFO]  --> Fetching gopkg.in/go-playground/validator.v8.
[INFO]  --> Setting version for gopkg.in/go-playground/validator.v8 to c193cecd124b5cc722d7ee5538e945bdb3348435.
[INFO]  --> Fetching gopkg.in/yaml.v2.
[INFO]  --> Fetching golang.org/x/sys.
[INFO]  --> Fetching google.golang.org/grpc.
[INFO]  --> Fetching google.golang.org/genproto.
[ERROR] Error scanning github.com\golang\protobuf\ptypes\any: open C:\Users\myhome\.glide\cache\src\https-github.com-golang-protobuf\ptypes\any: The system cannot find the path specified.
[ERROR] Failed to retrieve a list of dependencies: Error resolving imports

实际上,并没有C:\Users\myhome\.glide\cache\src\https-github.com-golang-protobuf\ptypes目录,但我不明白为什么会缺少这个目录。

我的glide.yaml文件如下所示:

package: .
import:
- package: cloud.google.com/go
  version: ^0.7.0
  subpackages:
  - bigquery
  - civil
- package: github.com/gin-gonic/gin
  version: ^1.1.4
- package: golang.org/x/net
  subpackages:
  - context
- package: golang.org/x/oauth2
  subpackages:
  - google
- package: google.golang.org/api
  subpackages:
  - iterator
- package: google.golang.org/appengine
  version: ^1.0.0
  subpackages:
  - datastore
  - log
  - memcache
  - remote_api

我该如何修复这个问题?

英文:

I am trying to manage my Go project with glide.

I executed glide update, but got The system cannot find the path specified error as below.

C:\path\to\myproject\src>glide update
[INFO]  Downloading dependencies. Please wait...
[INFO]  --> Fetching google.golang.org/appengine.
[INFO]  --> Fetching cloud.google.com/go.
[INFO]  --> Fetching golang.org/x/net.
[INFO]  --> Fetching github.com/gin-gonic/gin.
[INFO]  --> Fetching google.golang.org/api.
[INFO]  --> Fetching golang.org/x/oauth2.
[INFO]  --> Detected semantic version. Setting version for github.com/gin-gonic/gin to v1.1.4.
[INFO]  --> Detected semantic version. Setting version for google.golang.org/appengine to v1.0.0.
[INFO]  --> Detected semantic version. Setting version for cloud.google.com/go to v0.7.0.
[INFO]  Resolving imports
[INFO]  Found Godeps.json file in C:\Users\myhome\.glide\cache\src\https-github.com-gin-gonic-gin
[INFO]  --> Parsing Godeps metadata...
[INFO]  --> Fetching github.com/manucorporat/sse.
[INFO]  --> Setting version for github.com/manucorporat/sse to ee05b128a739a0fb76c7ebd3ae4810c1de808d6d.
[INFO]  --> Fetching github.com/mattn/go-isatty.
[INFO]  --> Setting version for golang.org/x/net to f315505cf3349909cdf013ea56690da34e96a451.
[INFO]  --> Fetching github.com/golang/protobuf.
[INFO]  --> Setting version for github.com/golang/protobuf to 2402d76f3d41f928c7902a765dfc872356dd3aad.
[INFO]  --> Fetching github.com/googleapis/gax-go.
[INFO]  --> Fetching gopkg.in/go-playground/validator.v8.
[INFO]  --> Setting version for gopkg.in/go-playground/validator.v8 to c193cecd124b5cc722d7ee5538e945bdb3348435.
[INFO]  --> Fetching gopkg.in/yaml.v2.
[INFO]  --> Fetching golang.org/x/sys.
[INFO]  --> Fetching google.golang.org/grpc.
[INFO]  --> Fetching google.golang.org/genproto.
[ERROR] Error scanning github.com\golang\protobuf\ptypes\any: open C:\Users\myhome\.glide\cache\src\https-github.com-golang-protobuf\ptypes\any: The system cannot find the path specified.
[ERROR] Failed to retrieve a list of dependencies: Error resolving imports

Actually there is not C:\Users\myhome\.glide\cache\src\https-github.com-golang-protobuf\ptypes directory, but I can not understand why this directory is missed.

Go Glide 错误 “系统找不到指定的路径”

My glide.yaml is as follows.

package: .
import:
- package: cloud.google.com/go
  version: ^0.7.0
  subpackages:
  - bigquery
  - civil
- package: github.com/gin-gonic/gin
  version: ^1.1.4
- package: golang.org/x/net
  subpackages:
  - context
- package: golang.org/x/oauth2
  subpackages:
  - google
- package: google.golang.org/api
  subpackages:
  - iterator
- package: google.golang.org/appengine
  version: ^1.0.0
  subpackages:
  - datastore
  - log
  - memcache
  - remote_api

How can I fix?

答案1

得分: 0

我发现github.com/golang/protobuf的版本2402d76f3d41f928c7902a765dfc872356dd3aad缺少ptype。我在glide.yaml中添加了以下行。

- package: github.com/golang/protobuf
  version: b50ceb1fa9818fa4d78b016c2d4ae025593a7ce3

b50ceb1fa9818fa4d78b016c2d4ae025593a7ce3是当前最新的提交。

错误已经消失。但是我不确定这是否是直接的方法,因为我仍然有以下警告。

[WARN]  Conflict: github.com/golang/protobuf rev is currently b50ceb1fa9818fa4d78b016c2d4ae025593a7ce3, but github.com/gin-gonic/gin wants 2402d76f3d41f928c7902a765dfc872356dd3aad

如果有其他更好的方法,请告诉我。

英文:

I found the github.com/golang/protobuf version 2402d76f3d41f928c7902a765dfc872356dd3aad which github.com/gin-gonic/gin wants does not has ptype. I added below lines to glide.yaml.

- package: github.com/golang/protobuf
  version: b50ceb1fa9818fa4d78b016c2d4ae025593a7ce3

b50ceb1fa9818fa4d78b016c2d4ae025593a7ce3 is the current newest commit.

The error has gone. But I am not sure this is the straightforward way because I still have the warning below.

[WARN]  Conflict: github.com/golang/protobuf rev is currently b50ceb1fa9818fa4d78b016c2d4ae025593a7ce3, but github.com/gin-gonic/gin wants 2402d76f3d41f928c7902a765dfc872356dd3aad

If another way is desirable, please advise me.

huangapple
  • 本文由 发表于 2017年5月10日 14:48:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/43885347.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定