Packaging and shipping a python library and scripts, the professional way

后端 未结 9 1472
执念已碎
执念已碎 2021-01-30 01:50

I have the task of packaging and shipping a commercial application bundle, which will include:

  1. a python library (developed by us)
  2. some python programs dep
9条回答
  •  春和景丽
    2021-01-30 02:07

    For windows I am doing this:

    1. Use cx_freeze like this:

      c:\Python27\Scripts\cxfreeze.bat source.py --target-dir=Bin 
      --base-name=Win32GUI --icon=icon.ico --target-name=Executable.exe
      

      This creates directory with runnable program.
      You can use another packing application such as PyInstaller (Windows, Linux), Py2Exe (Windows), or Py2App (Mac), but I got the best results with Cx_freeze (probably all platforms you mentioned). It has also very good support and is still actively maintained.

    2. Pack everything using Inno Setup (Windows).
      You can use any method to create installer you like. I am not familiar with other platforms.

    3. Test it in VMware virtual machine on clean OS installation just to be sure.

    Actually, it is very easy to do, I am not sure what to add.


    Edit: You can also use Portable Python for your bundled environment on Windows.

提交回复
热议问题