简体   繁体   中英

How properly bundle&install python to windows users

I need to redistribute Python 2.6 for my users.

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.

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.

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.

I wonder if in this case virtualenv will be the best option, but still have the issue of properly install it...

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.

I have worked on software that included its own bundled Python, and there were never any problems with conflicts. 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. A full Python with the stdlib pre-compiled to .pyo takes only ~10-20MB of space, depending on which modules you include. 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. Just in case you're only interested in a way to distribute a single app, take a look at py2exe .

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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