Edit: it looks like a weird thing about the python path going to a different path than the default one, and the modules weren't installed there. Ended up converting the script to exe instead
The Question:
Hi! I'm currently working on an Electron project that uses Python-Shell. It works fine in development, but when I try to package the app using electron-forge, it seems to throw an error every time and doesn't run. Any ideas on how to fix this? My project is here: [https://github.com/ekwong3/word-editor]. Thanks!
Any relevant python/javascript code:
Here's the code for the javascript:
`const { PythonShell } = require("python-shell");
Edit: it looks like a weird thing about the python path going to a different path than the default one, and the modules weren't installed there. Ended up converting the script to exe instead
The Question: Hi! I'm currently working on an Electron project that uses Python-Shell. It works fine in development, but when I try to package the app using electron-forge, it seems to throw an error every time and doesn't run. Any ideas on how to fix this? My project is here: [https://github.com/ekwong3/word-editor]. Thanks!
Any relevant python/javascript code: Here's the code for the javascript: `const { PythonShell } = require("python-shell");
function editText({ folderPath, find, replace, keepCase, processSub }) { let options = { mode: "text", args: [folderPath, find, replace, keepCase, processSub], }; PythonShell.run("editor.py", options) .then(() => { mainWindow.webContents.send("file:done"); }) .catch(() => { mainWindow.webContents.send("file:error"); }); }`