如何使用可移植Python和可移动Python安装pyInstaller [英] How to install pyInstaller with Portable Python and Movable Python

查看:180
本文介绍了如何使用可移植Python和可移动Python安装pyInstaller的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

便携式Python和可移动Python允许对python进行编程,而无需安装任何东西,仅需解压缩某些东西即可. :-)

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

我还希望能够从脚本中创建独立的可执行文件,但是我无法将pyInstaller绑定到这些软件包,因为pyInstaller需要pyWin32,但是pyWin32依赖于python注册表签名,而我没有它们正在使用便携式版本的python! 有什么解决方法吗?

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?

通过解压pywin32可执行文件(pywin32-217.win32-py2.7.exe),我得到了两个文件夹:PLATLIB和SCRIPTS;也许仅仅将这些文件夹移动到正确的Python Portable子文件夹就足够了吗?

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?

我正在使用:

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

推荐答案

显然,可以通过更改导入顺序来解决此问题.从 pyinstaller网站:

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.

这篇关于如何使用可移植Python和可移动Python安装pyInstaller的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆