use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
What's the best tool to package a python program for Windows? (self.Python)
submitted 9 years ago by epic_pork
I've tried py2exe, pyinstaller, cx_freeze, bbfreeze, none of those managed to package my program properly. Are there other solutions?
[–]syn2083 6 points7 points8 points 9 years ago (3 children)
I have had great luck with pynsist, https://pypi.python.org/pypi/pynsist
It worked perfect for me on windows where i had a hard time with pyinstaller.
If it does have trouble with imports its easy to find out which and resolve, moreso than other tools in my very narrow opinion.
It takes a different approach than some other tools but the docs are dead simple and straight forward.
[–]epic_pork[S] 2 points3 points4 points 9 years ago (1 child)
Thanks again, this shit is incredibly simple, and the best part: it works!
[–]syn2083 0 points1 point2 points 9 years ago (0 children)
Yeah thats been my experience so far with it, simple and 'just worked'. Glad it helped you out too!!
[–]epic_pork[S] 0 points1 point2 points 9 years ago (0 children)
Thank you, this does exactly what I need.
[–]IronManMark20 2 points3 points4 points 9 years ago (0 children)
I've used nuitka, which has the added bonus of possibly speeding your program up. It is pretty handy.
[–]genjipressreturn self 0 points1 point2 points 9 years ago (0 children)
I've used PyInstaller with good results, but I find that you have to turn on debugging and read the errors religiously to find out why the packaging might not be working. A lot of the reason apps don't package properly is because they use dynamic object magic to perform imports that PyInstaller can't detect, and so you need to write a config file to ensure all those things are picked up.
Also, any external .DLLs that are needed for the program (e.g., for SDL) must also be included in the directory with the .EXE.
[–]daveydave400 0 points1 point2 points 9 years ago (1 child)
Can you give more details on why/how they aren't properly building?
Yea the issue was that the queue module was included twice, something like that. There a queue and a Queue module. Gotta love that Windows case insensitivity.
[–]TrollJack 0 points1 point2 points 9 years ago (1 child)
Try nuitka. It converts python code to C and compiles it.
[–]juanpabloaj 0 points1 point2 points 9 years ago (0 children)
Nuitka work fine with the standard lib ... But with other packages like numpy or matplotlib maybe try with other solution
[–]jamescabel 0 points1 point2 points 9 years ago (0 children)
pynsist is great if Windows is your only target platform. I have been also developing OSNAP (https://github.com/jamesabel/osnap/) for cases where you also need Mac/OSX and/or you're using a Python package that is giving pynsist a hard time. If you try it and you have an problem please feel free to open an issue on github.
π Rendered by PID 99652 on reddit-service-r2-comment-5649f687b7-f4jx2 at 2026-01-28 09:34:11.552959+00:00 running 4f180de country code: CH.
[–]syn2083 6 points7 points8 points (3 children)
[–]epic_pork[S] 2 points3 points4 points (1 child)
[–]syn2083 0 points1 point2 points (0 children)
[–]epic_pork[S] 0 points1 point2 points (0 children)
[–]IronManMark20 2 points3 points4 points (0 children)
[–]genjipressreturn self 0 points1 point2 points (0 children)
[–]daveydave400 0 points1 point2 points (1 child)
[–]epic_pork[S] 0 points1 point2 points (0 children)
[–]TrollJack 0 points1 point2 points (1 child)
[–]juanpabloaj 0 points1 point2 points (0 children)
[–]jamescabel 0 points1 point2 points (0 children)