4

how do i make a linux installer from setup.py. I made an .msi from my setup.py file and here is the code for it

import cx_Freeze
executables = [cx_Freeze.Executable("Slither.py")]
cx_Freeze.setup(
        name="Slytherine",
        options = {
                      "build_exe": {
                                       "packages":["pygame"],
                                       "include_files": ["apple.png", "snake_head.png", "Score.dll"]
                                   }
                  },
        description = "Snake game",
        executables = executables
        )

What changes should be done in order to make a linux installer for it or do i have to build it on a linux machine itself?

2
  • 1
    Are you looking for just an executable or an installer? Commented Aug 11, 2015 at 7:42
  • preferably an installer but in worst case a executable would also do Commented Aug 11, 2015 at 7:45

1 Answer 1

2

Linux distributions use packages, which are usually deployed in repositories.

So you have two ways of distributing a python app.

  • Creating a python package, and uploading it to PyPI, so that users can install it with pip install yourapplication.
  • Creating linux distribution packages (.deb for debian based, rpm for redhat, ...).

I recommend reading the excellent Python Packaging user guide for understanding how does python packages work.

For linux distribution packages, well that is going to be different for every distribution, but for debian based distributions, have a look at stdeb which converts python packages into debian packages.

Sign up to request clarification or add additional context in comments.

1 Comment

Good answer. As a follow up comment, I'd suggest FPM as a tool for packaging for Linux.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.