gpt4 book ai didi

python - 无法在 Azure Web 应用程序上运行 EXE 文件

转载 作者:太空宇宙 更新时间:2023-11-04 05:08:06 26 4
gpt4 key购买 nike

我正在尝试在 Azure Webapp 上运行 exe 文件来自nodejs服务器。该exe是由PyInstaller从一个简单的python文件创建的。 .

var exec = require('child_process').exec; 
let cmd = 'hello.exe';
let child = exec(
cmd, {
cwd: path_to_exe_file
},
function(error, stdout, stderr) {
if (error === null) {
res.render('index', { title: stdout });
} else {
console.log(error);
res.json({
'status': '400',
'res': error
});
}
}
);

在我的计算机上一切正常,但当我部署到 Azure webapp 时出现错误:应用程序无法启动因为它的并排配置不正确

Error: Command failed: hello.exe The application has failed to start 
because its side-by-side configuration is incorrect.
Please see the application event log or use the command-line sxstrace.exe
tool for more detail.
at ChildProcess.exithandler (child_process.js:206:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) killed: false, code: 1, signal: null, cmd: 'hello.exe' }

如何解决这个问题?谢谢

最佳答案

Yes, the problem due to pyinstaller. How about .Net exe file, can I run .Net exe file in nodejs script on Azure Web Apps?

是的,基本上我们可以。而且它也可以在我的测试项目中使用最简单的 .NET 控制台 exe 运行。

但是有一些点我们需要注意,Azure Web App env 作为一个沙箱,有几个严格的限制和限制,并不是所有的 .NET exe 应用程序都可以在 Azure Web Apps 上执行。更多详情,您可以引用https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox .

另外,根据你的场景,你可以尝试考虑使用WebJobs运行一些 exe 应用程序或任务。

关于python - 无法在 Azure Web 应用程序上运行 EXE 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43806125/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com