为什么我的 Pyinstaller exe 在启动 Java 程序的那一行的其他计算机上失败?

Why my Pyinstaller exe fails on other computers on the line that starts a Java program?

我已经用一些我想用作可执行文件的代码实现了一个接口。
我使用 PyInstaller 从我的 .py

创建我的 .exe

我的 .exe 在我的电脑上 运行ning 很好。

但是当我尝试从另一台计算机 运行 它时,我得到了这个结果:

E:\global_nice_interface>global_nice_interface.exe
E:\global_nice_interface\stanford-corenlp-full-2018-10-05
Traceback (most recent call last):
  File "global_nice_interface.py", line 58, in <module>
  File "Preprocessing\launch_server.py", line 18, in start_NLP_server
  File "subprocess.py", line 769, in __init__
  File "subprocess.py", line 1172, in _execute_child
FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable
[11376] Failed to execute script global_nice_interface

我的代码中对应的行是:

subprocess.Popen('java -mx1g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port'+StanfordCoreNLP_port+' -tiemout 15000',cwd=StanfordCoreNLP_path)

变量 StanfordCoreNLP_path 和 _port 定义如下:

StanfordCoreNLP_path = os.path.abspath('stanford-corenlp-full-2018-10-05')
StanfordCoreNLP_port = '9000'

我通过打印检查 StanfordCoreNLP_path("result" 的第 2 行):它对应于想要的目录...

我有点迷茫:我不知道去哪里解决这个问题...

编辑:我不知道它是否重要,但我 运行 我的计算机和其他计算机上相同配置的 .exe:来自 USB键 (E:/).

在另一台计算机上安装 java 解决了我的问题。