go run main.go 一直提示找不到包的解决方案
作者:柴米yo 时间:2024-02-14 00:07:41
如下所示:
./src/github.com/sirupsen/logrus/terminal_check_notappengine.go:9:2: cannot find package "golang.org/x/crypto/ssh/terminal" in any of
已经在对应的路径里从githup上面下载了对应的包了
https://github.com/golang/crypto
但还是提示这个错误
当时项目运行在 ~/go目录下,引入的包之间相互调用不到
当把项目移动到~/go/src目录下时,就能正常运行了
GOPATH的目录是 ~/go
补充:go编译时包找不到的解决办法
1、github下载相应的包放到gopath目录
github本身不稳定,可以理解,发现bee 依赖的 gopkg.in/yaml.v2 不翻墙根本无响应,所以果断放弃go get ,
直接找到github上的源码地址
git clone https://github.com/go-yaml/yaml.git
在src 目录下 创建 gopkg.in 目录 把yaml 重命名为yaml.v2 ,然后在执行 go install
2、host做域名映射
通过https://site.ip138.com/sum.golang.org/ 查找域名可以访问的ip在host做域名映射
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。如有错误或未考虑完全的地方,望不吝赐教。
来源:https://blog.csdn.net/wangxinxinsj/article/details/83934179
标签:go,run,main.go,找包
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
解决mysql输入密码闪退的问题
2024-01-21 02:29:14
![](https://img.aspxhome.com/file/2023/2/119762_0s.png)
用Python复现二战德军enigma密码机
2022-04-12 23:22:59
![](https://img.aspxhome.com/file/2023/1/76191_0s.png)
mysql myisam 优化设置
2010-03-25 10:18:00
Vue2.x与Vue3.x中路由钩子的区别详解
2024-04-30 10:39:52
![](https://img.aspxhome.com/file/2023/9/130099_0s.png)
python3+PyQt5 实现Rich文本的行编辑方法
2023-09-29 14:37:47
Python中defaultdict与dict的差异详情
2023-10-02 19:39:29
python使用插值法画出平滑曲线
2021-07-14 03:59:02
Python内存管理实例分析
2021-06-13 01:39:21
![](https://img.aspxhome.com/file/2023/5/97745_0s.png)
通过python绘制华强买瓜的字符画视频的步骤详解
2022-03-01 05:42:43
![](https://img.aspxhome.com/file/2023/3/118663_0s.jpg)
mysql命令行如何操作
2024-01-20 09:41:18
![](https://img.aspxhome.com/file/2023/1/105221_0s.png)
python语言基本语句用法总结
2023-07-03 01:26:34
Perl下应当如何连接Access数据库
2008-12-04 13:06:00
Python中list列表的一些进阶使用方法介绍
2023-12-24 10:31:47
如何使数据库的ID字段自动加1?
2010-06-03 10:47:00
Python实现图片格式转换
2023-08-03 04:58:57
![](https://img.aspxhome.com/file/2023/7/60967_0s.jpg)
Python获取时间范围内日期列表和周列表的函数
2023-03-25 15:16:39
![](https://img.aspxhome.com/file/2023/8/75928_0s.png)
开启Django博客的RSS功能的实现方法
2022-06-16 02:02:04
![](https://img.aspxhome.com/file/2023/4/95674_0s.jpg)
PyQt5固定窗口大小的方法
2021-05-18 12:34:43
![](https://img.aspxhome.com/file/2023/0/99040_0s.jpg)
使用mss2sql工具将SqlServer转换为Mysql全记录
2024-01-24 11:59:37
![](https://img.aspxhome.com/file/2023/5/121305_0s.png)
MySQL中的联合索引学习教程
2024-01-21 23:49:34