如何将Python部署到Windows用户? [英] How to deploy Python to Windows users?
问题描述
我即将推出测试版应用,并且可以选择在<一个href =http://en.wikipedia.org/wiki/Python_(programming_language) =noreferrer> Python 。
I'm soon to launch a beta app and this have the option to create custom integration scripts on Python.
应用程序将针对 Mac OS X 和Windows,我的问题是Windows,其中Python通常不存在。
The app will target Mac OS X and Windows, and my problem is with Windows where Python normally is not present.
我的实际aproach默认运行Python 2.6安装。但是,当我使用时,默认情况下不会激活该路径,但没有设置该路径命令行选项。而且我担心如果以前安装了Python,我升级到一个新版本,这可能会破坏别的东西...
My actual aproach is silently run the Python 2.6 install. However I face the problem that is not activated by default and the path is not set when use the command line options. And I fear that if Python is installed before and I upgrade to a new version this could break something else...
所以,我想知道如何可以干净地完成。如果我复制整个Python 2.6目录,并把它放在我的应用程序的一个子目录中,并安装所有的东西,它可以吗?或者使用virtualenv可以运行不同的Python版本(如果Python已经安装在机器上)。
So, I wonder how this can be done cleanly. Is it OK if I copy the whole Python 2.6 directory, and put it in a sub-directory of my app and install everything there? Or with virtualenv is posible run diferents versions of Python (if Python is already installed in the machine?).
我还在使用DLL嵌入Python之前玩,并发现它容易,但我失去了调试能力,所以我切换到命令行插件。
I also play before embedding Python with a DLL, and found it easy but I lost the ability to debug, so I switch to command-line plug-ins.
我从命令行执行插件并读取STDOUT和STDERR输出。该应用程序是由德尔福/拉撒路制作的。我安装其他模块,如JSON和RPC客户端,Win32com,ORM等。我使用 bitrock 创建安装程序。
I execute the plug-ins from command line and read the STDOUT and STDERR output. The app is made with Delphi/Lazarus. I install others modules like JSON and RPC clients, Win32com, ORM, etc. I create the installer with bitrock.
更新:最终用户是小企业主,Python脚本由开发人员制作。我想避免部署中的任何其他步骤,所以我想要一个完全集成的设置。
UPDATE: The end-users are small business owners, and the Python scripts are made by developers. I want to avoid any additional step in the deployment, so I want a fully integrated setup.
推荐答案
复制一个便携式Python 文件夹,与您的Delphi / Lazarus应用程序相同的文件夹。为此设置所有路径。
Copy a Portable Python folder out of your installer, into the same folder as your Delphi/Lazarus app. Set all paths appropriately for that.
这篇关于如何将Python部署到Windows用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!