drny60365 2016-04-27 21:58
浏览 372
已采纳

错误:标准软件包中的非标准导入“ gopkg.in/yaml.v2”

I'm trying to import go-yaml, from https://github.com/go-yaml/yaml, and I'm seeing an error that Google isn't helping with.

I ran go get gopkg.in/yaml.v2, but I am getting the error: start.go:6:5: non-standard import "gopkg.in/yaml.v2" in standard package "boxcar" when I try to run my program. I'm not doing anything exotic in my import, either:

package main;

import (
    "os"
    "net"
    "gopkg.in/yaml.v2"  
)

Any help would be appreciated!

  • 写回答

1条回答 默认 最新

  • douren9077 2016-12-07 05:13
    关注

    Go has 2 paths that must be defined in os environment, GoRoot and GoPath, GoRoot is installation path of Go, there are only "standard packages" in it. GoPath is working folder, there are 3rd party (non-standard) packages in it, your source code folder should be in GoPath and be recognized as non-standard package. like C:\gopath\src\yourproject

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法