从J调用Python(Anaconda)时出现问题

2024-10-04 09:28:11 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用ProcessBuilder从Java调用Python(Anaconda)代码。当我只安装Python时,它运行得很好。但现在我移除了Python,安装了Python。调用Python的代码现在不工作。 获取以下错误。在

 com.api.ai.helper.MLPythonAPI callPyhonScriptToPredict
SEVERE: null
java.io.IOException: Cannot run program "python": CreateProcess error=2, The system cannot find the file specified
       at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
       at com.api.ai.helper.MLPythonAPI.callPyhonScriptToPredict(MLPythonAPI.java:66)

我使用python3.6.1(anaconda3 4.4.0 64位)和以下代码来执行python

^{pr2}$

有人能帮我吗。在


Tags: 代码helpercomapi错误anacondajavanull