0

What are some options for packaging a python web server (i.e. flask, tornado, quart, sanic, etc.) that uses numpy inside an electron application?

I took a look at PyOxidizer, but could not find any examples in the documentation to suggest that this is possible with it.

chaimp
  • 16,897
  • 16
  • 53
  • 86
  • 1
    check out : https://stackoverflow.com/questions/32158738/python-on-electron-framework – JonSG Feb 12 '23 at 23:15
  • 1
    It's unspecific. There's are many Python packaging tools, such as PyInstaller, PyOxidizer, py2exe, etc. You need to evaluate them, choose one, and ask a specific question if you confront a problem. Anyway here's my opinion - I would not use any Python packaging tool because Electron provides the built-in packaging tool. – relent95 Feb 13 '23 at 01:29
  • @relent95 "Electron provides the built-in packaging too" - do you mean to just include a python virtualenv in the electron bundle? What about numpy and openblas? – chaimp Feb 14 '23 at 03:57
  • You create a ```requirements.txt``` with ```pip freeze```, install a fresh new Python distribution in a specific root directory, install all the required packages with the ```pip``` in that root directory and the previously created ```requirements.txt```, and package that root directory with Electron. – relent95 Feb 14 '23 at 04:12
  • You maybe need to set environment variables, such as ```PYTHONNOUSERSITE=1```. – relent95 Feb 14 '23 at 04:59

0 Answers0