Articles of pyinstaller

通过pip安装pyinstaller导致“无法创build进程”

有谁知道为什么pyinstaller立即失败后,通过pip通过anaconda 32bit安装anaconda 32bit ? 我安装pyinstaller通过pip install pyinstaller通过在Windows 64位使用32位anaconda anaconda命令提示符(因为我想创build32位可执行文件) 是的,我读了pyinstaller – 版本无法创build进程和点/ easy_install失败:未能创build进程和如何安装pyinstaller使用点 我没有重命名15分钟前安装anaconda的任何文件,pycharm 10分钟前和pyinstaller 5分钟前。 我卸载pyinstaller通过pup卸载并重新安装在anaconda脚本文件夹,这没有做任何事情。 任何有识之士? #windowsfrustrationspathC:\Users\me\Anaconda\Lib\site-packages>PyInstaller

如何让其他人在不安装Python的情况下运行你的Python程序

我用Python做了第二个程序。 这是一个计算二次方程根的程序。 我觉得这很酷,我想让我的朋友们使用它,而不必让他们安装python。 我从朋友那里听说过Pyinstaller,我试过这个方法:首先我在cmd中inputpip install pyinstaller 。 然后我改变目录到包含我想与我的朋友分享的文件的文件夹(它被称为vkv.py )。 然后我input这个命令: pyinstaller vkv.py但我得到这个错误: Indexerror: tuple index out of range 。 显然问题是我有Python 3.6.0和Pyinstaller只能使用Python 3.5以上的版本。 所以我不得不尝试另一种方法。 昨天,我尝试了cx_Freeze和其他一些我忘记的方法,但都失败了。 Cx_Freeze失败,因为我有Python 3.6.0(与Pyinstaller相同),我不记得其他方法出了什么问题。 我的朋友(谁告诉我关于Pyinstaller)告诉我使用virtualenv,所以我查了一个关于这个问题的教程。 看起来我需要创build一个使用Python 3.5的虚拟环境。 所以这些是我在cmd中input的命令: pip install virtualenv mkdir Environments cd environments virtualenv -p C:\Users\hp\AppData\Local\Programs\Python\Python35\python.exe py35_env (在input这个命令之前,我安装了Python 3.5.0) C:\Users\hp\Environments\py35_env\Scripts\activate 现在环境已经被激活了,我在这个环境下pip install pyinstaller ,用pip install pyinstaller 。 然后,我将目录更改为: C:\Users\hp\Desktop\Code\Python testing (这是vkv.py文件所在的位置)。 […]

pyInstaller:导入错误

我在Windows中,使用pyInstaller打包python文件。 但是发生了一些错误: Traceback (most recent call last): File "<string>", line 2, in <module> File "D:\Useful Apps\pyinstaller-2.0\PyInstaller\loader\iu.py", line 386, in i mportHook mod = _self_doimport(nm, ctx, fqname) File "D:\Useful Apps\pyinstaller-2.0\PyInstaller\loader\iu.py", line 480, in d oimport exec co in mod.__dict__ File "D:\Useful Apps\pyinstaller-2.0\server\build\pyi.win32\server\out00-PYZ.p yz\SocketServer", line 132, in <module> File "D:\Useful Apps\pyinstaller-2.0\PyInstaller\loader\iu.py", line 386, in i mportHook mod […]

Python Windows服务pyinstaller可执行文件错误1053

我已经在python中写了一个Windows服务。 如果我从命令提示符运行我的脚本 python runService.py 当我这样做的服务安装并正确启动。 我一直在尝试使用pyinstaller创build一个可执行文件,因为我已经看到了与py2exe相同的问题。 当我运行.exe服务安装,但不启动,我得到以下错误 error 1053 the service did not respond to the start or control request in a timely fashion 我看到很多人都有这个问题,但似乎无法find一个明确的答案,如何解决这个问题。 winservice.py from os.path import splitext, abspath from sys import modules, executable from time import * import win32serviceutil import win32service import win32event import win32api class Service(win32serviceutil.ServiceFramework): _svc_name_ = '_unNamed' _svc_display_name_ = […]

PyInstaller构buildWindows EXE失败,多处理

在我的项目中,我使用Python的multiprocessing库在__main__中创build多个进程。 该项目正在打包到一个单一的Windows EXE使用PyInstaller 2.1.1。 我创build了如下的新进程: from multiprocessing import Process from Queue import Empty def _start(): while True: try: command = queue.get_nowait() # … and some more code to actually interpret commands except Empty: time.sleep(0.015) def start(): process = Process(target=_start, args=args) process.start() return process 在__main__: if __name__ == '__main__': freeze_support() start() 不幸的是,当将应用程序打包到EXE中并启动它时,我在这一行中得到了WindowsError 5或6(似乎是随机的): command = queue.get_nowait() […]

pyinstaller和onefile生成导致错误加载Python DLL(错误代码14001)

我使用pyinstaller从我的脚本文件中创build一个exe文件。 我的脚本是mysql_backup.py 我跑 pyinstaller –onefile mysql_backup.py 产量 52 INFO: wrote C:\Users\vlahopou\PycharmProjects\TestClient\mysql_backup.spec 73 INFO: Testing for ability to set icons, version resources… 104 INFO: … resource update available 105 INFO: UPX is not available. 128 INFO: Processing hook hook-os 219 INFO: Processing hook hook-time 223 INFO: Processing hook hook-cPickle 276 INFO: Processing hook hook-_sre 368 INFO: […]

我可以在构buildpyinstaller可执行文件时控制体系结构(32位和64位)吗?

简短的问题 在构buildpyinstaller可执行文件时,有没有办法控制/保证体系结构(32位和64位)? 背景 我从py2exe迁移到pyinstaller是因为缺乏64位的支持以及一些我很难看的过去的小事情。 所以在这个笔记上,我不想回到它。 我使用Python 2.7 64位开发了两个应用程序,并且在32位机器上运行时遇到性能问题。 首先是一个简单的wxPython GUI(版本2.9),并连接到一个USB驱动程序的Windows DLL文件。 这个看起来非常“安全”,以32位的方式运行,因为没有只有64位的模块。 但是,在32位Windows XP上运行时,这个应用程序在与USB设备交谈时会遇到可怕的性能问题。 第二个应用程序要大得多,我还没有试图build立和运行,因为害怕架构问题。 这个应用程序只有一个64位的模块(psycopg2)。 我想远离试图build立这个如果不可能作为一个32位的可执行文件运行。 当前的想法 我觉得这可能是可行的(如果模块有32位支持),通过在32位模式下强制运行python build.py。 这有意义吗? 更新 我在build设的第一个项目上有了几个突破。 事实certificate,性能问题完全取决于两台机器的速度。 我的开发机器有足够的能力来轮询USB设备足够快,而慢得多的testing平台(Windows XP)没有。 我通过修改USB端口轮询的方式解决了这个问题。 现在,这是固定的,我可以在两个系统上运行exe。 尝试将可执行文件构build为单个文件时,出现了一个新问题。 当运行pyinstaller的Build.py时,它将引入应用程序需要运行的所有必需的DLL。 这似乎起初工作很好,但是当我试图运行我build立在Windows 7 64位的单个exe,它不会在Windows XP上运行,因为USBencryption狗的DLL不被识别为有效的DLL。 为了让单个exe在两个系统上运行,我首先尝试从.spec文件(它似乎是一个python脚本)中删除DLL。 这很方便,因为我可以使用普通的python list修饰符修改build命令之前的包含列表。 我的希望是,如果在exe的临时目录中找不到该DLL,它会在系统PATH上find它。 虽然这种方法可能工作,但我不能没有抛出很多错误就运行。 我的第二个尝试是在Windows XP机器上build立应用程序(离开DLLembedded),希望Win XP DLL能够在Windows 7中工作。成功! 这个configuration工作正常。 但是我坚信,这不是最好的解决scheme,因为它完全依赖于在较新的操作系统上运行的较旧的DLL。

在Windows XP下运行Python二进制文件

我将PySide应用程序编译为x32和x64模式,并在Windows 7 +下工作。 但是我发现应用程序无法在Windows XP下启动。 我应该额外使用spec-file中的一些技巧吗? 当前PyInstaller脚本显示在下面的app.spec文件中: pyinstaller src / app.spec # -*- mode: python -*- import os import platform from PySide import QtCore onefile = False console = False platform_name = platform.system().lower() app_name = {'linux': 'app', 'darwin': 'app', 'windows': 'app.exe'}[platform_name] # Include imageformats plugins plugins=os.path.join(os.path.dirname(QtCore.__file__), "plugins\\imageformats") static_files = Tree(plugins, 'plugins\\imageformats') static_files += [('app.ico', 'src\\app.ico', […]

无法与pyinstaller一起使用pyexcel-xls。 python可执行文件不工作。 python版本3.4.4

该程序运行时使用: Python filename.py 但是当我使用“ pyinstaller ”创build它的可执行文件时 pyinstaller -F filename.py 可执行文件已成功创build,但脚本的执行失败并引发以下错误。 Traceback (most recent call last): File "site-packages\pyexcel_io\manager.py", line 160, in create_reader File "site-packages\pyexcel_io\manager.py", line 222, in _get_a_handler pyexcel_io.manager.NoSupportingPluginFound: No suitable library found for xls During handling of the above exception, another exception occurred: Traceback (most recent call last): File "script.py", line 8, in <module> File […]

什么是“版本文件”的样子?

我已经使用这个多年,现在没有结果。 PyInstaller手册说: –version-file =文件 从文件添加一个版本资源到exe文件 听起来不错。 我想把版本信息放在我的可执行文件中。 问题是,我不知道“版本文件”是什么样子,我找不到一个我可以使用的例子。 我会考虑一个版本文件的例子作为这个问题的可接受的答案。 我试过了 手册还说: 版 只有Windows NT家族。 版本= 'myversion.txt'。 使用GrabVersion.py从可执行文件中窃取版本资源,然后编辑输出以创build自己的。 (版本资源的语法太神秘了,我不会试图从头开始编写一个。) 我已经尝试过从我的系统中无数的可执行文件。 我只是不断收到这些错误: 回溯(最近一次通话最后): 文件“C:\ pyinstaller-2.0 \ utils \ GrabVersion.py”,第42行, vs = versioninfo.decode(sys.argv [1]) 在解码的文件“C:\ pyinstaller-2.0 \ PyInstaller \ utils \ versioninfo.py”,第33行 nm = win32api.EnumResourceNames(h,RT_VERSION)[0] IndexError:列表索引超出范围 在没有版本信息的可执行文件上,并且: 回溯(最近一次通话最后): 文件“C:\ pyinstaller-2.0 \ utils \ GrabVersion.py”,第43行, 打印vs 在__repr__文件“C:\ pyinstaller-2.0 \ […]