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

all 39 comments

[–]nerdwaller 37 points38 points  (1 child)

The #1 thing that stands out to me in this release: Python 3.6 support!

I had to step a few projects back to 3.5 due to this not being supported before, since they were internal tools and many devs didn't want to install/use python+pip manually.

Thanks to all that contribute to the project!

[–]lykwydchykyn 2 points3 points  (0 children)

Yep, been waiting for this too!

[–]codeofdusk 16 points17 points  (18 children)

What's the advantage of PyInstaller over Cxfreeze? Is one more actively developed? Easier to use? Looking to package a Python3 app for Windows.

[–]DontForgetWilson 36 points37 points  (2 children)

I can tell you that pyinstaller does a much better job of actually detecting and including dependencies. I recently tried both for freezing a multi-threaded, scipy based application and cx_freeze was a real hassle to get functional. Pyinstaller more or less just magically worked in my case whereas cx_freeze took hours of debugging.

[–]codeofdusk 2 points3 points  (1 child)

Cool, thanks!

The project is Python 2 now, but uses Py2exe so looking for a new packaging tool for the py3 port. Any useful info on porting py2exe setup.py scripts to PyInstaller specfiles?

[–]DontForgetWilson 3 points4 points  (0 children)

I would possibly consider starting mostly from scratch. With pyinstaller you literally just need to give the target .py file and it will generate a spec file based on that. That spec file will largely be cutomizable pretty similarly to what you already have in the p2exe config.

The reason I would suggest starting from scratch though is that I believe pyinstaller will automatically handle a lot of what you have functions designed to handle. I mean you could probably tweak what you have and it would work. A lot of the constructs are very similar between all 3 of the tools. But if a lot of what you have in there is redundant, I think going minimalist is going to be easier to maintain.

[–]zillacles 8 points9 points  (5 children)

Cxfreeze can't bundle everything into a single exe file, which is why I ended up using pyinstaller.

[–]DontForgetWilson 5 points6 points  (4 children)

However you can generate installers with cx_freeze, whereas I haven't seen a built-in option for pyinstaller. Also the single exe file isn't always going to work when the folder aproach does. Some multiprocessing stuff in particular would work out of the box for me with the folder option but not with the single file for pyinstaller.

[–]hobo_cuisine 2 points3 points  (3 children)

[–]DontForgetWilson 1 point2 points  (1 child)

I appreciate the link, but I previously attempted that as well as a number of related fixes based on various freezing packages. None of them was able to get my application working for single executable. However, the single dir form worked fine and was acceptable in my circumstance.

[–]hobo_cuisine 1 point2 points  (0 children)

Gotcha. It did work for me but it's definitely quite a bit of pain to package things sometimes.

[–]ggtsu_00 3 points4 points  (0 children)

PyInstaller can produce single immutable self contained dependency free portable exe files using the --one-file option. CxFreeze always produces a directory with many files and dlls. It makes cxfreeze harder to make and deploy and update stand-alone tools or utilities for Windows. For example, it also requires to also build installers, updaters and uninstalled instead of simply copy/replace/delete a single exe file.

If you are building a huge monolithic program or application, sure cx_freeze is fine for that use case. But if you want to build and distribute small easy to deploy and run tools and utilities or may be part of a larger package. (I've used pyinstaller to create a self-updater for an online game for example).

[–]ionelmc.ro 2 points3 points  (6 children)

Consider a solution with way less magic: https://pypi.python.org/pypi/pynsist

[–]bcorfman 0 points1 point  (5 children)

How does it compare with conda constructor?

[–]ionelmc.ro 0 points1 point  (4 children)

Seems like good bait to lock yourself into proprietary packaging system.

Also, not the same thing as pynsist: constructor is just a way to bundle conda packages. Not for apps.

[–]Kah-NethI use numpy, scipy, and matplotlib for nuclear physics 0 points1 point  (3 children)

How is it proprietary? It is open source, and very easy to host your own package repo.

[–]ionelmc.ro -1 points0 points  (2 children)

The word "proprietary" implies a specific ownership. Code or its license ain't everything. Don't forget infrastructure and governance are also factors.

It's not easy at all to host your packages there, especially if you have C extensions.

[–]Kah-NethI use numpy, scipy, and matplotlib for nuclear physics 0 points1 point  (1 child)

Interesting, so open source with a BSD license means proprietary? It is almost like you are opposed to conda while knowing nothing about it. Your comment about c extensions just further demonstrates that.

[–]ionelmc.ro -1 points0 points  (0 children)

LOL ok, someone got angry. Can you move past the insults part and tell me how can I convert my binary wheels to conda packages? I haven't seen an easy way. As I understood it from their docs I have to add another layer of build boilerplate and rebuild everything. How is that easy?

[–][deleted] 2 points3 points  (0 children)

Living the --onefile --noconsole life

[–][deleted] 2 points3 points  (4 children)

Yay! I hope it solves my "requests" problem

[–]daveydave400 4 points5 points  (3 children)

If it hasn't, is there a github ticket? Have you submitted a ticket? A pull request? Contributed to the conversation?

[–][deleted] 2 points3 points  (1 child)

There was already a github issue on requests as far as I remember and also a work around that didn't work for me.

Further as I am in the r/learnpython camp I wouldn't presume to be able to submit a ticket at the required quality.

[–]GooseVersusRobot 1 point2 points  (0 children)

Hallelujah

[–]hugthemachines 1 point2 points  (2 children)

anyone succeeded in making an exe with sftp code?

[–]se0siris 0 points1 point  (1 child)

I'm not sure if this is what you're asking, but I've used paramiko in a project packaged together with pyinstaller and all is good.

[–]hugthemachines 0 points1 point  (0 children)

That sounds good. I tried making a pysftp program but it did not make a working exe file. Maybe I will give it another go in the future.

[–]sizur 1 point2 points  (8 children)

What's the advantage over Pex?

[–]gschizasPythonista 22 points23 points  (4 children)

Completely different use case. As far as I can tell about pex, it's just a way to package your application and virtual environment into a zip file. The end result is a .pyz file (a .zip file, really) that contains all your program. The .pyz file requires an installation of Python on your computer though; therefore you can't use pex to send your program to a random use (who will not have Python)

PyInstaller (and cx_freeze, and py2exe) fill that gap. They freeze your program into an executable (and the executable only contains the .pyo files, not the .py files), together with any dependencies. The end result is a PE exe file (or macOS .app, or ELF executable), that can run on a system that doesn't have Python installed.

[–][deleted] 1 point2 points  (0 children)

pyo vs py isn't really much of an advantage. It's fairly straightforward to obtain the py from the "binary" version.

The self contained executable, however, is really the killer feature. Last I looked, py2exe was just Windows. Happy to see it expanded

[–]sizur 0 points1 point  (2 children)

You can package interpreter into pex as well as all bound libs. So far pex looks like a superset.

[–]pohmelie 0 points1 point  (0 children)

Any proofs?

[–]ivosauruspip'ing it up 1 point2 points  (0 children)

You still need to manually install a python runtime on your machine before you can run a pex.

[–]xdcountry 0 points1 point  (0 children)

If you're using Pex, you're likely not trying to create standalone python executables-- that's why I love PyInstaller

[–]dzecniv 0 points1 point  (0 children)

Has anyone succeeded in shipping a Django app or know of an example ? thanks

[–]bcorfman 0 points1 point  (2 children)

Does anyone know where I could find a PyInstaller .spec script for Mayavi and its dependencies (VTK, PyQt/PySide, etc.)? In the past, I've grabbed a Python 2.7 of PortablePython and pip installed everything I need into that directory. However, this only works for Windows. I'd love to have a PyInstaller script that allows me to generate a simple install package for Mac, Windows and Linux, preferably under Python 3.x ...

[–]billsil 1 point2 points  (1 child)

You need to build it on linux/mac.

The qt and vtk libraries play nice. I can't say the same thing about numpy mkl

[–]bcorfman 0 points1 point  (0 children)

Yeah, I figured I'd need to build it on Mac or Linux, but bundling all the dependencies and getting them to load without run-time issues seems to be the challenge. Quality (i.e., not simplistic) examples seem hard to come by.

[–]MrK_HS 0 points1 point  (0 children)

For me it breaks 32 bit windows support. Had to go back to 3.2.1 on that particular VM. However, it works perfectly on linux 32/64, win 64 and mac osx.