@@ -23,7 +23,7 @@ func Test() (err error) {
//exec.Command("bin/bash", "-c")
//cmd := exec.Command("/usr/local/bin/python3.9", "-c", "/Users/roc/go/src/eta/eta_index_lib/test2.py")
//cmd := exec.Command("python3", "-c", "./test2.py")
- cmd := exec.Command("python3", "/Users/roc/go/src/eta/eta_index_lib/test2.py")
+ cmd := exec.Command(utils.PYTHON_PATH, "/Users/roc/go/src/eta/eta_index_lib/test2.py")
outputByte, err := cmd.Output()
//fmt.Println(err)
fmt.Println("start")
@@ -485,7 +485,7 @@ print(output)
}
pythonCode = fmt.Sprintf(pythonCode, path, period, seasonal, trend, fraction, seasonalDeg, trendDeg, lowPassDeg, robustStr, toPath)
- cmd := exec.Command(`python3`, "-c", pythonCode)
+ cmd := exec.Command(utils.PYTHON_PATH, "-c", pythonCode)
_, err = cmd.CombinedOutput()
if err != nil {
return
@@ -160,6 +160,9 @@ func init() {
PYTHON_MONGO_AUTH_MECHANISM = config["python_mongo_auth_mechanism"] // python链接认证机制
PYTHON_PATH = config["python_path"]
+ if PYTHON_PATH == "" {
+ PYTHON_PATH = "python3"
+ }
REDIS_CACHE = config["beego_cache"]
if len(REDIS_CACHE) <= 0 {