Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > What is the best way to freeze a Python 3 app (Windows)?

Thread Tools

What is the best way to freeze a Python 3 app (Windows)?

Paul Moore
Posts: n/a
I want to package up some of my Python 3 scripts to run standalone,
without depending on a system-installed Python. For my development, I
use virtualenv and install all my dependencies in the virtualenv,
develop the script and test it. When I'm done, I want to build an
executable which can run without depending on a system Python. What's
the best way of doing this? I previously would have used py2exe, but
that seems not to have Python 3 support. I have heard good things
about bbfreeze, but the author has stated that he has no intention of
supporting Python 3 just yet. I've tried cx_Freeze, but I've hit a
number of niggly problems which make me think it's not quite suitable
(I've reported some of them on the cx_Freeze mailing list, but it
seems pretty quiet - no real response).

That leaves me wondering if there's another option, or whether I
should just roll my own. if I zip up the stdlib, and my virtualenv
site-packages, and then put them plus the various Python DLLs in a
directory, copy my script in, and write a small EXE to set PYTHONHOME
and run Py_Main with my script as argument, that should do. But it
seems a bit laborious

Is that really the best way?

Things I care about:
- Easy to package up a script
- Works with dependencies in a virtualenv
- Completely isolated from system Python (not even leaving directories
on sys.path, so I can do basic tests without having to create a clean
system with no Python installed).

Things I don't (really) care about:
- Stripping ununsed modules (although I'd like to omit "big" parts of
the stdlib that aren't used - tkinter and test come to mind)
- Space (the full stdlib is only 30M including pyc files, after all)

Any suggestions gratefully accepted

Reply With Quote
Andrew Berg
Posts: n/a
cx_Freeze is the only program that can freeze py3k code that I know of.
I didn't have any major issues with it, but I've only played with it.
In any case, if you're going to roll your own, I'd be happy to help test it.

CPython 3.2.2 | Windows NT 6.1.7601.17640
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
the easiest way to convert a .net windows app to web app? tom ASP .Net 4 10-24-2008 05:57 PM
Looking for a way to access ActiveRecord data in a rails app fromanother non-rails app with $SAFE=1 Xeno Campanoli Ruby 1 05-29-2008 12:21 PM
freeze string fails to freeze ??? Ruby 5 03-15-2007 11:29 PM
What's the best Python freeze tool? Nick Python 2 01-19-2004 10:35 PM
Is SOAP the best RPC to use between a Java app and a COM based app? TheRookie Java 0 01-19-2004 07:27 PM