Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #22629 > unrolled thread

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

Started byPaul Moore <p.f.moore@gmail.com>
First post2012-04-03 13:01 -0700
Last post2012-04-03 15:23 -0500
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  What is the best way to freeze a Python 3 app (Windows)? Paul  Moore <p.f.moore@gmail.com> - 2012-04-03 13:01 -0700
    Re: What is the best way to freeze a Python 3 app (Windows)? Andrew Berg <bahamutzero8825@gmail.com> - 2012-04-03 15:23 -0500

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

FromPaul Moore <p.f.moore@gmail.com>
Date2012-04-03 13:01 -0700
SubjectWhat is the best way to freeze a Python 3 app (Windows)?
Message-ID<b8f530eb-5840-4f57-ad39-c9c9f0d7004c@12g2000vba.googlegroups.com>
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 :-)

Paul.

[toc] | [next] | [standalone]


#22633

FromAndrew Berg <bahamutzero8825@gmail.com>
Date2012-04-03 15:23 -0500
Message-ID<mailman.1294.1333484668.3037.python-list@python.org>
In reply to#22629
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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web