Это мой скрипт PythonSHELL в моем электроне. js:
const {PythonShell} = require('python-shell');
const path = require('path');
const options = {
mode: 'text',
pythonPath: 'C:/Users/abdou/AppData/Local/Programs/Python/Python38/python.exe',
scriptPath: isDev ? `${path.join(__dirname, "db")}`: `${path.join(__dirname, "../../build/db")}`,
};
mainWindow.webContents.on('did-finish-load', ()=>{
PythonShell.run('p.py', options, function (err, results) {
if (err) throw err;
// results is an array consisting of messages collected during execution
mainWindow.webContents.send('data', results[0]);
})
});
и это мой пакет. json тег script:
"react-start": "react-scripts start",
"react-build": "react-scripts build",
"react-test": "react-scripts test --env=jsdom",
"react-eject": "react-scripts eject",
"electron-build": "electron-builder",
"release": "yarn react-build && electron-builder --publish=always",
"build": "yarn react-build && yarn electron-build",
"start": "concurrently \"cross-env BROWSER=none yarn react-start\" \"wait-on http://localhost:3000 && electron .\""
и этот тег сборки:
"build": {
"appId": "com.gs_client_descktop",
"asar": false,
"extraResources": [
"**/db/**/*"
]}
ошибка сообщения :
Uncaught Exeption:
spawn C:/Users/abdou/AppData/Local/Programs/Python/Python38/python.exe ENONENT
at Process.ChildProcess._handle.onexit(intrnal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections(internal/process/task_queues.js:77:11)
Спасибо .