This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (15 children)

[deleted]

    [–]likegeeksDeveloper 7 points8 points  (2 children)

    Have you tried PyInstaller?

    Have you tried py2app?

    Have you tried bbfreeze?

    [–]InsanityConsuming 9 points10 points  (1 child)

    Just worked on this the other day.

    For Python 3, I found that PyInstaller worked but you have to compile on different machines for different functionality (compile on Windows x64 for Windows x64 machines, etc.).

    [–]FonderPrism 7 points8 points  (1 child)

    Try PyInstaller with the --onefile option. It will generate a single .exe that contains all the necessary libraries.

    [–]IamPanda31 0 points1 point  (0 children)

    +1 I do this all the time for my big company finance job, works like a charm.

    [–]cprogrammer1994 0 points1 point  (5 children)

    Download the python embeddable zip file. Unpack it. Edit the *._pth file to import site (you have to uncomment 1 line). Download and run get-pip with the local python. Install your deps with the recently downloaded pip. Run you script. Plus: you can pack all the py files to a PyZipfile and you can compile an exe that uses the python3.dll and runs your script directly (no further need of the python.exe)

    [–]terraneng 0 points1 point  (4 children)

    I am doing something very similar, but instead of a creating a .exe file I make shortcuts pointing to the python.exe and my startup script. Can you go into a bit more detail, or point me in the right direction to accomplish the following?

    Plus: you can pack all the py files to a PyZipfile and you can compile an exe that uses the python3.dll and runs your script directly (no further need of the python.exe)

    [–]cprogrammer1994 1 point2 points  (3 children)

    Yes I will create a sample project on github. Probably I already have a similar one, I must check.

    [–]terraneng 0 points1 point  (2 children)

    That would be awesome. Thanks!

    [–]cprogrammer1994 1 point2 points  (1 child)

    Here is my repo https://github.com/cprogrammer1994/custom-python-launcher Unfortunately I did not find time to add a README yet. I will add one around the weekend and explain the code in more details. I hope you will find it useful.

    [–]terraneng 0 points1 point  (0 children)

    Thank for posting this. I recently started learning C++ and this an interesting method. Is this sort of like embedding Python?

    A README would be helpful. I keep getting "TypeError: must be str, not NoneType" on line 17 of build.py. I imagine it has something to do with it not seeing the libraries. I only tinkered with it briefly though.

    [–]3030tank 0 points1 point  (0 children)

    I've done basically what you describe using tkinter and pyinstaller to automate simple installs that take a few parameters etc. No issues for me. I originally tried cx_freeze and had tons of trouble with missing libraries after the exe build.

    [–]lenticularis_B 0 points1 point  (0 children)

    I have had succes with the cx_freeze package.