简体   繁体   English

如何正确捆绑和安装python到Windows用户

[英]How properly bundle&install python to windows users

I need to redistribute Python 2.6 for my users. 我需要为我的用户重新发布Python 2.6。

Currently, I execute the silent instalation for the msi installer from http://www.python.org/download/ , but I have some problems, like if other version of python is installed this not get the default. 目前,我从http://www.python.org/download/执行msi安装程序的静默安装,但是我遇到了一些问题,比如安装了其他版本的python,这不是默认设置。

In the other hand, despite this could be rare, if a user have already python and I install my own, then could cause a conflict. 另一方面,尽管这可能是罕见的,如果用户已经python并且我安装了自己的,那么可能会导致冲突。

So, which could the best curse of action? 那么,这可能是最好的行动诅咒? How automate this install?. 如何自动安装? I already have http://installbuilder.bitrock.com but the available django stack is too large for my app, and I need to pre-install several python modules. 我已经有了http://installbuilder.bitrock.com,但可用的django堆栈对我的应用来说太大了,我需要预先安装几个python模块。

I wonder if in this case virtualenv will be the best option, but still have the issue of properly install it... 我想知道在这种情况下virtualenv将是最好的选择,但仍然有正确安装它的问题...

I haven't used it, beyond some initial research, but ActiveState's ActivePython generally does what you want, if you're looking for a commercial pre-built solution. 除了一些初步的研究之外,我还没有使用过它,但是如果你正在寻找一个商业化的预构建解决方案,ActiveState的ActivePython通常会做你想要的。

I have worked on software that included its own bundled Python, and there were never any problems with conflicts. 我曾经研究过包含自己的捆绑Python的软件,冲突从来没有任何问题。 In our case, it was installed alongside the rest of the software, rather than C:\\Python26, and it was intended for the software's use only, not as a replacement for any existing Python on the system. 在我们的例子中,它与软件的其余部分一起安装,而不是C:\\ Python26,它仅用于软件的使用,而不是作为系统上任何现有Python的替代品。 A full Python with the stdlib pre-compiled to .pyo takes only ~10-20MB of space, depending on which modules you include. 使用stdlib预编译到.pyo的完整Python只需要大约10-20MB的空间,具体取决于您包含的模块。 So I wouldn't worry about the possible redundancy. 所以我不担心可能的冗余。

It also makes your life easier to have your own copy, since you know exactly which versions of all the third-party libraries you have; 它还使您的生活更容易拥有自己的副本,因为您确切知道您拥有的所有第三方库的版本; you don't have to worry about the user upgrading something that breaks your app. 你不必担心用户升级破坏你的应用程序的东西。 The counter-argument is that some users may want the latest versions of libraries, for security reasons. 反驳的是,出于安全原因,一些用户可能想要最新版本的库。 But in my experience, those users are in a very slim minority, and for them it just boils down to a little more work. 但根据我的经验,这些用户的数量很少,对他们而言,这只是归结为更多的工作。

Finally, I presume you have reasons for wanting a full Python installation. 最后,我认为你有理由想要完整的Python安装。 Just in case you're only interested in a way to distribute a single app, take a look at py2exe . 如果您只对分发单个应用程序感兴趣,请查看py2exe

尝试查看此视频( 如何在Windows上分发Python应用程序 )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM