How to run python production on customer environment
Asked Answered
G

1

13

I have some python application that should run on customer site. I compile my py files to pyc (python byte code).

What is the standard way to run the app on the customer environment? The options I see are:

  • As part of my installer, install some python distribution, i.e Anaconda.
  • Require the customer to have python installed in their environment.
  • Bring python libraries and executable along with my code and run it directly from my installation dir.
  • Convert the scripts to exe using some py-to-exe tool.

Application usage: The app is used as a tool to calculate statistics for my main product. The customer won't run it explicitly. It won't have any GUI.

Customer environment will be x64 Windows machine. No other restrictions.

Any recommendations or comments? I couldn't find such discussions on the web.

Goldiegoldilocks answered 5/9, 2016 at 6:13 Comment(2)
since you mention anaconda, do you rely on specific conda packages being installed? also is this supposed to be a server application i.e. something that has a remote API of some sort?Sufferable
I think the proper solution now days would be to package the app in a docker imageGoldiegoldilocks
I
3

Given your requirements, the last two options seem most viable:

  • Bring python libraries and executable along with my code and run it directly from my installation dir.
  • Convert the scripts to exe using some py-to-exe tool.

You can either package your code, or freeze your code and create an executable for the target OS.

Given your requirements, I'd suggest the latter. You can go through the Python Packaging Guide for more details regarding packaging.

Interrupter answered 6/9, 2016 at 15:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.