cunnane / xloil

xlOil provides framework for interacting with Excel in different programming languages (python & C++ currently)
Other
126 stars 11 forks source link

Can you deploy to Windows client without installing python? #101

Closed cognociente closed 6 days ago

cognociente commented 4 months ago

I ask because it's cumbersome and potentially error-prone to have to install python in its entirety for each desktop client that you would need using your software. I know that python has some ways of compiling to executable code (exe, dll) but how could xloil link to such pre-compiled code?

cunnane commented 3 months ago

I've been looking into doing this with PyInstaller and pynsist. It won't work out-of-the-box but I think something is possible using these tools, I will keep you updated.

The end result is likely to be an installer which deploys a reduced python distribution and installs xloil. If you rely on packages such as pandas or scipy, the installer will get quite large.

It won't be possible to reduce everything to a single XLL (in fact this might be possible, for certain sets of packages, but would be a large project with considerable work and code-borrowing from PyInstaller)

In fact, you don't need to "install" python - you can just copy the directory containing it. xlOil does need to be installed using xloil install (this can be invoked programmatically from xloil.command_line.install_xloil), so a script could handle the deployment by: 1) Copy prepared python distribution to

2) Activate the python distribution at (by bringing it's Scripts directory onto the PATH) 3) Run xloil install my_xloil.ini where my_xloil.ini is a preconfigured settings file in which LoadModules, etc. has been configured. The XLOIL_PATH and PYTHONEXECUTABLE settings will be updated automatically by xlOil's installer.

cunnane commented 1 month ago

I've added some fairly rudimentary packing support with PyInstaller in v0.19.0, see the docs. This doesn't result in everything being packaged into a single XLL - I'm not sure if that's really possible in python - but does avoid the need to install python.