2

I need to compile a python 3 program made of multiple files and using many libraries (like PyQt5, matplotlib...) in a standalone executable for Linux, Mac and Windows using Cython. The executable must work on a computer without requesting installation of any libraries and must also protect the source code.

I suppose there should be an easy way to do that but after more of 2 weeks of searching I still don't find anything working. All the tutorials I found are very unclear and are not working... (for instance this one : https://medium.com/@xpl/protecting-python-sources-using-cython-dcd940bb188e )

If somebody can help me with a good step by step tutorial to do that It would be help me very much.

Thanks a lot in advance !

EDIT : the question was marked duplicate but I don't agree.

I'am sorry but How to make a Python script standalone executable to run without ANY dependency? don't provide a working solution for a program with many files !

daveturner
  • 188
  • 1
  • 9
  • 2
    I think the answers involving pyinstaller and py2exe are a solution - they can bundle things using into a single (large) exe file (e.g. `pyinstaller --onefile`). Cython really is pretty unsuitable for this purpose and I would abandon it. I'll try to find some relevant links - it's definitely been asked multiple times before – DavidW Nov 28 '19 at 18:57
  • 1
    If you're insisting on Cython it probably should be a duplicate of https://stackoverflow.com/questions/52959902/make-executable-file-from-multiple-pyx-files-using-cython instead. I think though that including _all_ the libraries (including standard library) is a big task and I really recommend you don't do it – DavidW Nov 28 '19 at 19:00
  • 1
    Alternatively https://stackoverflow.com/questions/55707869/build-cython-compiled-modules-and-python-code-into-executable-binary-using-pyins might be useful for a recipe for compiling individual modules with Cython, then using `pyinstaller --onefile` (for if the binary compilation is important to you) – DavidW Nov 28 '19 at 19:23
  • 1
    Thank for answers, I will watch theses post. But aren't some more step by step tutotials for this ? I guess I am not the single one to be stuck on this exact kind of situation. – daveturner Nov 29 '19 at 01:20

0 Answers0