fyears / electron-python-example

Electron as GUI of Python Applications
MIT License
2k stars 234 forks source link

Packaged path vs dev path #11

Closed MonkeyChap closed 6 years ago

MonkeyChap commented 6 years ago

Hi,

Bit of a long-shot, but I'm trying to do something similar to your project - running python scripts inside an electron app. I'm finding that the python path reported by python changes between the dev run (npm start) and the packaged app.

It's pretty impossible to avoid having more than one python version on a mac, as it needs the default 2.7 installed for os-related scripts. When the app compiles/packages, it's reverting to the 2.7 path instead of the anaconda 3.6 path usually available when run in dev mode.

Did you encounter this problem also ?

Thanks

Ian

fyears commented 6 years ago

if you wan to distribute your app, please compile the python app using something like pyinstaller, so that the executable itself contains its python, and doesn't use the system one.