views:

30

answers:

1

I need to deploy a embeded version of python26.

I have it working under windows folowing the setup of http://www.portablepython.com/.

However after read this I try to pack everything into a zip file, and left out python.exe, python26.dll. However, that not work if python is not pre-installed.

Also, I try pre-compilling everything with python -m compileall ., but not do the trick.

When run python this way, this is the error:

'import site' failed; use -v for traceback

This is the traceback:

# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# zipimport: found 1283 names in D:\Bajados\Adobe\python26.zip
'import site' failed; traceback:
ImportError: No module named site

I want to know the inner details that could make this work.

A: 

Py2EXE will do this for you, it fits nicely with distutils, so with a couple dozen lines of declaration in setup.py you'll get a nice windows application package without any python dependencies. Also, you can integrate further with Innosetup which gives you a great single-file-installer package.

knitti
I can't use that way. I have a windows embeded web server that use python. Is not a python app to be deployed, is a windows app that use python (like tortoise hg)
mamcx
what way do you use it? I can't rellay tell from the question and your comment. As far as I can see there's no contradiction between a py2exe-type deployment and a portable python installation (the latter one being of course more generic). Whats your use case? (And sorry, I don't want to dissect tortoise-hg to understand)
knitti