安全导入模块挂钩后[PixInstaller] PyInstaller最大递归错误[six.moves] [英] PyInstaller maximum recursion error after pre-safe import module hook [six.moves]
问题描述
我正在尝试使用PyInstaller将我的python3.5项目转换为.exe文件我的主文件是SegTool.py
I am trying to use PyInstaller to convert my python3.5 project into an .exe file My main file is SegTool.py
这是我的.spec文件:
This is my .spec file:
# -*- mode: python -*-
block_cipher = None
a = Analysis(['SegTool.py'],
pathex=['consts.py', 'FetalMRI_about.py', 'FetalMRI_mainwindow.py', 'FetalMRI_workspace.py', 'image_label.py', 'main_window.py', 'scan_file.py', 'segment3d_itk.py', 'Shapes.py', 'workspace.py', 'C:\\Users\\Keren Meron\\Documents\\School Work\\Fetal MRI\\FetalSegBrainTool'],
binaries=[],
datas=[('images', 'images')],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_n_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='SegTool',
debug=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='SegTool')
也许我对相关的钩子和依赖项了解得还不够,但是我崩溃了:
Maybe I don't understand enough the hooks and dependencies related, but I am getting a crash:
File "C:\Users\Keren Meron\WinPython-64bit-3.5.3.1Qt5\python-3.5.3.amd64\lib\ast.py", line 245, in visit
return visitor(node)
File "C:\Users\Keren Meron\WinPython-64bit-3.5.3.1Qt5\python-3.5.3.amd64\lib\ast.py", line 253, in generic_visit
self.visit(item)
File "C:\Users\Keren Meron\WinPython-64bit-3.5.3.1Qt5\python-3.5.3.amd64\lib\ast.py", line 245, in visit
return visitor(node)
RecursionError: maximum recursion depth exceeded
在回溯之前的输出(DEBUG和INFO处于打开状态):
The output (DEBUG and INFO are on) right before the traceback:
10923信息:缓存模块挂钩...10937信息:分析SegTool.py13458 INFO:处理安全前导入模块的第六个钩子.14204 INFO:处理预安全导入模块挂钩win32com14205调试:win32com:使用dir'C:\\ Users \\ Keren Meron \\ WinPython-64bit-3.5.3.1Qt5 \\ python-3.5.3.amd64 \\ lib \\ site-packages \\ win32comext'扩展__path__14604 INFO:处理预查找的模块路径挂钩distutils16281 INFO:处理预查找的模块路径挂钩站点16284信息:站点:重定向到伪目录'C:\\ Users \\ Keren Meron \\ WinPython-64bit-3.5.3.1Qt5 \\ python-3.5.3.amd64 \\ lib \\ site-packages \\ PyInstaller\\ fake-modules'40968 INFO:处理安全前导入模块挂钩请求.packages.urllib3.packages.six.moves51591调试:load_module:'C:\\ Users \\ Keren Meron \\ WinPython-64bit-3.5.3.1Qt5 \\ python-3.5.3.amd64 \\ lib \\ site-packages \\ jinja2 \\ asyncsupport中的SyntaxError.py'
请帮助,我该怎么办才能解决此问题?
Please help, what do I need to do to fix this?
谢谢
推荐答案
这可能为时已晚,但我也遇到了此问题,并通过在顶部的规范文件中添加了几行代码来解决此问题:
This might be too late, but I faced this issue too, and fixed it by adding a couple of lines of code in the spec file at the top:
# -*- mode: python -*-
import sys
sys.setrecursionlimit(5000)
block_cipher = None
希望它也可以解决您的问题,如果它仍然打开!
Hopefully, this fixes you issue too, if it is still open!
这篇关于安全导入模块挂钩后[PixInstaller] PyInstaller最大递归错误[six.moves]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!