Is there a recommended method for packaging Python applications?
In particular, I was planning to package TiddlyWeb.
As a first step I have created some basic scripts that make it reasonably straightforward to set up TiddlyWeb on Windows, using Portable Python.
While I've tried to adhere to the recommended directory structure, I haven't yet managed to compile a proper PortableApps package (being a Linux developer, I find it a little hard to motivate myself to work on Windows specifics).
Obviously that would be a very nice thing to have, as it would make for a much more user-friendly experience.
There's also the question of whether and how Portable Python should be used for this purpose. I understand this Python dependency issue has come up before, but has yet to be resolved?
Any guidance and assistance would be most welcome!
We don't distribute a Python Portable which can be used by all Python applications; it's quite a troublesome issue due to multiple versions, libraries, etc.
Executables generated with py2exe is the only format that we support - we have official releases of Task Coach and BPBible which are both wxPython applications which use py2exe to generate Windows binaries.
I am a Christian and a developer and moderator here.
“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1
There are a pyton portable version, which is refered by python web page.
Denis J Navas
It's not suitable for distribution of other programs though, only really for development of programs and running things from source. Reread my response concerning multiple versions and libraries.
I am a Christian and a developer and moderator here.
“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1
Thanks for your response.
I'm barely familiar with py2exe at this point, so I'm not sure what the implications of this are.
Would each script (e.g. daemon, admin) require a separate frozen binary? What about extensibility with third-party modules - would that require recompilation?
I realize this is a tricky issue.
However, there might be an elegant solution; on Unix, it's not unusual to have multiple versions of Python (2.x, 3.x) available on the same system - conceivably, PortableApps could take a similar approach (with each app depending on a specific version rather than just Python)? With regards to libraries, virtualenv might be used to provide isolated Python environments for each application, thus avoiding conflicts.
I'd been thinking more along the lines of putting Python in CommonFiles and any extras in the application's directory, something like App\PythonPath (or another directory in CommonFiles for a large one which is used by more than one thing, like wxWidgets, which would automatically then get added by the launcher to the PYTHONPATH environment variable so Python would find it. The problem with that was that site-packages could still be located and written to by a Python script - anyone trying to easy_install something would end up with things in the wrong place without a bit more fiddly Python code to change its impression, which I hadn't looked at yet. I've heard of virtualenv but never thought to look at it... thanks, it looks like it might do a better job with it. Some time I may see about making a Python segment for the PortableApps.com Launcher and a shared Python package (I think I'd do 2.5, 2.6 and 3.0 branches).
Applications like Blender still wouldn't be able to use this shared Python though; they must use their own binaries, to a large extent at least (though Inkscape, another such, could probably work with a different Python in the PATH, I think).
I am a Christian and a developer and moderator here.
“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1
Sounds good.
For the moment, I'll probably hold off on creating a PortableApps package for TiddlyWeb, due to the py2exe-related concerns mentioned above (and admittedly also because I'm not keen on working with Windows too much).
We don't distribute a Python Portable which can be used by all Python applications; it's quite a troublesome issue due to multiple versions, libraries, etc.
could you elaborate on this? If you bundle stripped down version of PP which is used for this single application, what is the issue around multiple versions??
kind regards
Perica Zivkovic
http://PortablePython.com
The argument of this post is size rather than complexity.
The problem I see is that some applications require a specific version of Python; generally it's ">= 2.3" (or 2.4 or 2.5) but there are things which break with 2.5, and so for them you'd end up having to have a Python 2.4 environment. I like to do size comparisons in most of these things; while I don't have all the statistics as I haven't tried to get them, the gist of it is:
This post is very bitsy... don't expect to get much useful out if it. The biggest problem in my opinion is forcing a CommonFiles directory. It makes the whole process much less flexible (not necessarily bad) and more fiddly for the user.
I am a Christian and a developer and moderator here.
“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1
Is there any ready-to-unpack TiddlyWeb implementation yet ?
I can accept even non-portableapps.com version. I just don't know how to install TiddlyWeb correctly on Windows.
Please reply.
> Is there any ready-to-unpack TiddlyWeb implementation yet ?
I'm afraid not. So far nobody has stepped up to do the (presumably not very demanding) task of packaging it up for Windows.
Any assistance is still welcome, of course.