Python PyInstaller运行时错误?(R6034)
我终于让PyInstaller构建了一个exe文件,但它没有运行。我一打开它,就会在对话框中看到:Python PyInstaller运行时错误?(R6034),python,pyinstaller,Python,Pyinstaller,我终于让PyInstaller构建了一个exe文件,但它没有运行。我一打开它,就会在对话框中看到: Runtime Error! Program C:\.....\MCManager.exe R6034 An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information.
Runtime Error!
Program C:\.....\MCManager.exe
R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contact the application's support team for more information.
这是我的规格:
# -*- mode: python -*-
a = Analysis(['MCManager.py'],
pathex=['C:\\Users\\Lucas\\Dropbox'],
hiddenimports=[],
hookspath=None)
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name=os.path.join('dist', 'MCManager.exe'),
debug=False,
strip=None,
upx=True,
console=False,
icon='MCManager.ico')
app = BUNDLE(exe,
name=os.path.join('dist', 'MCManager.exe.app'))
我环顾四周,似乎没有人有同样的问题
如果它改变了一切,这个脚本将使用wxPython。这似乎是类似的问题 看看您是否可以使用该解决方案: 通过使用 onedir选项而不是onefile,然后只需移动清单 到包含单个文件可执行文件的目录,该目录允许 这很难奏效
似乎他们正在3.0中修复它,我最近开始收到“运行时错误”(R6034) 它位于一个可靠的现有python程序上,我以前使用pyinstaller将其编译成一个文件。我注意到这个问题只发生在我编译完exe后重新命名它之后。一旦我把它重新命名为原始的exe名称,R6034就消失了
莱森学会了。。。使用pyinstaller生成后不要重命名您的exe。如果您需要您的exe具有不同的名称,请更改源py名称,然后重新编译。我也有同样的问题,没有重命名任何内容,我只生成-F并在版本3.2中崩溃,但在版本2.1中不会出现此错误 链接: 我的建议?pip卸载pyinstaller 之后,您应该安装版本2.1,并准备再次运行。 /setup.py构建 /setup.py安装
祝你好运我本打算留下评论,但没有足够的代表。虽然有人问我这个问题,但我最近遇到了同样的问题,结果证明这是Pyinstaller 3.2版的一个错误 升级到pyinstaller 3.2后,生成的exe以R6034终止: PyInstaller 3.2,OneFile R6034,32位Python 2.7.11 看起来他们已经在最新的开发版本中修复了这个问题,建议
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
在我的需求文件中使用它而不是pyinstaller==3.2为我修补了它 如果在pyinstaller构建的exe中调用popen,也可能发生此错误。要修复此错误,必须为popen调用的stdout使用显式文件句柄,如下例所示
import sys
import subprocess
from PyQt4 import QtGui
def verify_license():
tmp_file = '.license_output'
try:
with open(tmp_file, 'w+') as file_obj:
proc = subprocess.Popen(['echo', 'hi'], shell=True,
stdout=file_obj, stderr=subprocess.STDOUT,
stdin=subprocess.PIPE)
ret = proc.wait()
if ret != 0:
sys.exit(-1)
with open(tmp_file, 'r') as file_obj:
output = file_obj.read()
except Exception as err:
sys.exit(-1)
if 'hi' not in output:
raise Exception('bad news: output was %s' % (output))
def main():
app = QtGui.QApplication(sys.argv)
w = QtGui.QWidget()
w.resize(250, 150)
w.move(300, 300)
w.setWindowTitle('Simple')
w.show()
sys.exit(app.exec_())
if __name__ == '__main__':
verify_license()
main()
我现在也有同样的问题,使用onedir对我也很有效。然而,我是pyinstaller的开发者版本,所以它似乎没有被修复。我在pyinstaller 3.2和Python2.7.11中遇到了同样的问题。回到pyinstaller 3.1解决了这个问题:)这对我来说很有效,所以在某些情况下,至少这是正确的答案!到目前为止答案是正确的。这就是我从PyInstaller 2.1切换到3.4后R6034出现问题的原因。事实上,重命名exe非常好,但当您这样做时,还需要重命名清单!PI生成一个清单,供您在运行时解析VC再发行dll加载。Windows要求exe和清单共享一个基本名称,以便关联它们并尊重清单。