解决:
:: windows切换环境 activate gdal3.3.1
// 先切换环境再执行脚本 String cmd = "D:\\ars\\m2m\\activate.cmd && " ; // 切换环境 += " python D:\\ars\\m2m\\tvdi.py" ; // 执行脚本 += " --LC08_fn --shape_fn" ; // 传递参数 logger.info("-------------------> " + cmd + " <-------------------"); // 执行 Process p = Runtime.getRuntime().exec(cmd); String read, result = ""; BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream(), "gbk")); while ((read = in .readLine()) != null) { result += read; p.waitFor(); // 返回结果 logger.info("-------------------> " + result + " <-------------------");
# 查找 whereis conda # 查找 which python > /root/miniconda3/envs/mmenv/bin/python
@Test void testDk() throws IOException, InterruptedException { String cmd = "/root/miniconda3/envs/mmenv/bin/python ~/0predict1.py"; Process p = Runtime.getRuntime().exec(cmd); String read, result = ""; BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream(), "gbk")); while ((read = in.readLine()) != null) { result += read; p.waitFor(); logger.info("-------------------> result: " + result + " <-------------------");
本文地址:https://www.0558.la/article/433784cd9475d5666a89.html
上一篇:bundle是什么意思bundlergt230versionError...
下一篇:新注册的域名多久可以备案新注册的域名要如...