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; us开发者_JS百科e -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.
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.
Perhaps look into the flag Py_NoSiteFlag = 1;
精彩评论