drux41001 2014-08-11 08:39
浏览 58
已采纳

Golang-如何运行引用包的命令

I am new to Golang, and trying to run a command from the following package:

https://github.com/ryanbressler/CloudForest

The command proposed in the Quick Start section of the package is:

growforest -train train.fm -rfpred forest.sf -target B:FeatureName

but I am not sure how to use the command.

I have cloned the package on my D drive, and tried running it in Ms-dos window and get an error:

d:\DATA-SCIENCE\Go>go run growforest -train train.fm -rfpred forest.sf -target B:FeatureName
go run: no go files listed

I also tried running the command inside a go file, but that doesn't work either:

package main

import (
    "github.com/ryanbressler/CloudForest"
)

func main() {
    growforest -train train.fm -rfpred forest.sf -target B:FeatureName
}

Can anyone help me understand how this is supposed to be used?

  • 写回答

1条回答 默认 最新

  • doulan8152 2014-08-11 08:42
    关注

    You need to install the package first

    go install
    

    Then the growforest command will be available in your GOPATH\bin (which should be part of your PATH environment variable)

    Ideally, you should do a go get github.com/ryanbressler/CloudForest, which will clone and build and install the repo in GOPATH/src/github.com/ryanbressler/CloudForest.
    See "Download and install packages and dependencies".

    From the README, you need to install specific parts of the project:

    go get github.com/ryanbressler/CloudForest
    go install github.com/ryanbressler/CloudForest/growforest
    go install github.com/ryanbressler/CloudForest/applyforest
    
    #optional utilities
    go install github.com/ryanbressler/CloudForest/leafcount
    go install github.com/ryanbressler/CloudForest/utils/nfold
    go install github.com/ryanbressler/CloudForest/utils/toafm
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊
  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写
  • ¥20 Qcustomplot缩小曲线形状问题
  • ¥15 企业资源规划ERP沙盘模拟
  • ¥15 树莓派控制机械臂传输命令报错,显示摄像头不存在
  • ¥15 前端echarts坐标轴问题