How to install pyInstaller with Portable Python and Movable Python

时光总嘲笑我的痴心妄想 提交于 2019-12-11 01:27:27

问题


Portable Python and Movable Python allow programming python without installing anythin, just by unpacking something. :-)

I'd like also to be able to create standalone executable from my scripts, nut I can't tie pyInstaller to these packages, as pyInstaller requires pyWin32, but pyWin32 relies on python registry signatures, and I have not them as I'm using portable version of python! Any workaround?

By unpacking pywin32 executable ( pywin32-217.win32-py2.7.exe) I get two folders, PLATLIB and SCRIPTS; maybe it's enough just to move these folder to the right Python Portable subfolder?

I'm using:

  • Windows XP
  • PortablePython_2.7.3.1 (Portable Python)
  • movpy-2.0.0-py2.5.1 (Movable Python)
  • pyinstaller-pyinstaller-v2.0-107-gecb2882 (PyInstaller)
  • pywin32-217.win32-py2.7 (PyWin32)

回答1:


Apparently it can be fixed by changing the order of imports. From the pyinstaller site:

In order to make pywin32 works with portable python pywintypes must be loaded before
any win32 library ....... Swapping the two lines "import win32api" and "import
pywintypes" in bindepend.py (line 44 and 45 on commit 0837e8a....) fixes the issue.

It fixed the same problem for me.



来源:https://stackoverflow.com/questions/12196184/how-to-install-pyinstaller-with-portable-python-and-movable-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!