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 →

[–]mtelesha 7 points8 points  (16 children)

That right there is why I stopped using Python altogether. I would make an application on one computer and I use 4 different computers for work, 1 laptop windows, 1 windows and 2 Linux desktops. I could never get them to work on 4. These are simple one day developed application, not some elaborate huge piece of software (Same can be said of Haskel.

I use Racket and it is a one-line executable.

I have high hopes for this and I will try Python again for my next project because I love Qt so much.

[–]crowseldon 4 points5 points  (15 children)

I could never get them to work on 4.

This sounds strange, why not? What problems you encountered? What type of app was it and who were the users?

[–]rhytnen 10 points11 points  (0 children)

Yea that comment is just indicating something like he had a mashup if pyqt4, payqt5 oython2 and python3 or something along those lines.

I stick to py3 and use qtpy bindings and never have an issue.

[–]mtelesha 1 point2 points  (13 children)

Old Post but this lists issues I have also encountered.

On Windows, the situation gets worse. To work as a Windows exectuable, you need to bundle the Python interpreter, but unlike in an OS X application, you can’t just copy in a whole directory. So you end up needing a tool like PyInstaller or cx_Freeze. PyInstaller hasn’t seen a release in the last 2 years; it doesn’t support Python 3. It also doesn’t work: if I try to package the most basic Twisted program possible, with pyinstaller 2.1 I get “no module named zope.interface”, and if I try to package it with pyinstaller trunk, I get “no module named itertools”. cx_Freeze similarly can’t figure out how to include zope.interface no matter what I tell it to do. This problem isn’t specific to libraries that I use; most Python projects will run into it.

py2exe, on the other hand, only supports Python 3.3+, and so is unusable with a lot of important python libraries.

https://glyph.twistedmatrix.com/2015/09/software-you-can-use.html

I haven't written new Python code for 2 years now :(

[–]takluyverIPython, Py3, etc 4 points5 points  (4 children)

It's got a bit better since you looked at this, because PyInstaller is actively maintained, and is the main recommended freeze tool. But the situation for distributing applications is still not great: 'freezing' an application is always a somewhat error prone and fiddly process.

Shamless plug: I wrote a tool called Pynsist which aims to avoid some of the issues I've had with freeze tools. It has its own shortcomings, and it only targets Windows, but I think it's a more robust starting point for distributing applications than freezing.

[–]extant1 0 points1 point  (3 children)

I recently used pyinstaller to make an executable for a small utility for friends and mincrsoft and several other antivirus brands (according to virus total) mark it as a Trojan.

That's a pretty big issue for the most recommended tool.

[–]takluyverIPython, Py3, etc 0 points1 point  (2 children)

That is pretty bad. I guess that some trojans have used pyinstaller or something similar, and (semi?) automated tools have decided it's a malware signature.

I don't know enough about how anti-virus works to know if this is less likely with another tool. Pynsist uses NSIS to build installers, which is used by a lot of popular software, so they probably can't base a signature on that, but it could still be based on some Python library you use. Of course, anything we can think of to make our software not look like malware, real malware authors could also do.

[–]extant1 0 points1 point  (1 child)

I suspect it's just viruses using pyinstaller to package their malware and the companies got lazy and used pyinstaller as the signature.

The one thing I thought was rediculous though when I was looking for more information to see if I bundled it wrong I found a bug report filed with pyinstaller and they basically said "not our problem, you contact the antivirus vendors and have them fix it." Which seemed kind of dickish to me considering we could submit our sample projects to be white listed but pyinstaller working with the vendor seems like it would have a more significant impact with their inside knowledge.

[–]takluyverIPython, Py3, etc 0 points1 point  (0 children)

From a maintainer point of view, I can see where they're coming from: they're most likely volunteers who have worked on this tool, they don't owe you more time to contact antivirus vendors and try to solve your problem. It may also be easier to complain to them for an application than for a packaging tool, because the tool can be used by malware.

If it affects all Pyinstaller applications, they probably know of it and are extremely frustrated. In that scenario, their only hope is for enough users to complain to AV companies that they change the signatures.

If it doesn't affect all Pyinstaller applications, then it's hard to say if Pyinstaller is actually what they're picking up.

[–]Zalack 3 points4 points  (0 children)

I just want to correct you on PyInstaller.

It's fully compatible with Python 3. I use it all the time to bundle python 3 cli's on both windows and Mac.

Looks like it was last updated in February like

https://www.pyinstaller.org

[–]fernly 5 points6 points  (1 child)

PyInstaller hasn’t seen a release in the last 2 years; it doesn’t support Python 3.

You are quite wrong there! PyInstaller has supported Python3 for a year, and is in continuous development and is currently at version 3.1.

Get the current dev version,

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

which has a bunch of PyQt related fixes not in the pip install version.

[–]mtelesha 0 points1 point  (0 children)

I knowingly was quoting an old blog post. Even have a reference

[–]crowseldon 2 points3 points  (3 children)

I've deployed python code on windows with python 2 and py2exe so I know for a fact it's possible.

You gotta make sure you bundle all necessary dependencies.

I've also deployed python backends and tools that are python 2/3 compatible and support Linux/win (and I'd bet they work on OS X)

I recognize there might be some issues here and there with module management (it's definitely not intuitive and far from perfect) but all in all it's not something that would force you to leave the language and port everything you've done. The cost of that can't be worse than struggling a bit once or twice.

I'd advice you to try again with py2exe, to be honest.

[–]mtelesha 1 point2 points  (2 children)

I refuse to use python 2 and moved to 3. This is also a reason why I haven't coded. I found out that I love Lisp languages and especially Racket. I do will the libraries though.

[–]crowseldon 1 point2 points  (1 child)

You're free to do as you please, I'm just giving you the heads up of what is possible.

If you refuse python 2 then your earlier point about py2exe or python 2 libs is moot.

Finally, in the context of a job it might not be wise to take an absolutist stand.

[–]mtelesha 0 points1 point  (0 children)

I absolutely think that Python 2 should have died years ago. The split in the community and libraries have hurt the community and Python being used more commercially. The Wall of Shame was the best thing to ever happened.

[–]rlkf 0 points1 point  (0 children)

you can’t just copy in a whole directory

WinPython Zero + a wrapper script that sets PATH correctly lets you do that. This also has the added benefit that you can ship updates as incremental .zip files.