开发者

Distribute a Python program with a minimal environment

开发者 https://www.devze.com 2022-12-12 11:34 出处:网络
I want to distribute a Python application to windows users who don\'t have Python or the correct Python version.

I want to distribute a Python application to windows users who don't have Python or the correct Python version.

I have 开发者_StackOverflowtried py2exe conversion but my Python program is really complex and involve code import on the fly by xmlrpc process so it is not suitable for py2exe.

The complete Python folder takes around 80MB but this includes docs and a lot of non-essential things.

Do you know if there exists a small package of a minimal Python interpreter I can include with my program ? Include a folder of 80MB is a bit big ;)


PyInstaller is a py2exe "competitor" that has many extras (such as being cross-platform, supporting popular third party packages "out of the box", and explicitly supporting advanced importing options) -- it might meet your needs. Just be sure to install the SVN trunk -- the existing (1.3) release is way, WAY obsolete (PyInstaller is under active development again since quite a while, but I can't convince the current maintainers to stop and do a RELEASE already -- they're kind of perfectionists and keep piling more and more great goodies, optimizations, enhancements, etc, into the SVN trunk instead;-).


Have a look at Portable Python. This will install a Python programming environment in a local folder. I am sure that you could strip many unwanted things off.

I recommend however that you give py2exe another chance.


..involve code import on the fly by xmlrpc process so it is not suitable for py2exe

Py2exe can deal with situations like this. You just have to tell it which modules are being imported at runtime, so that it includes them in the distribution. Your code should then be able to import from these modules dynamically.


püy2exe is bad and incompabilite to Windows 10 now.

I suggest you use BoxedApp Packer until 22 mb small without runtimes....

enter link description here

It is almost better than py2exe because py2exe need many py files and opened data files...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号