开发者

How make work import of python26.zip on windows

开发者 https://www.devze.com 2023-01-15 02:47 出处:网络
I need to deploy a embeded version of python26. I have it working under windows folowing the setup of http://www.portablepython.com/.

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;

0

精彩评论

暂无评论...
验证码 换一张
取 消